You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@mesos.apache.org by "Michael Park (JIRA)" <ji...@apache.org> on 2016/04/04 22:04:25 UTC

[jira] [Created] (MESOS-5107) Introduce a typed error handling mechanism

Michael Park created MESOS-5107:
-----------------------------------

             Summary: Introduce a typed error handling mechanism
                 Key: MESOS-5107
                 URL: https://issues.apache.org/jira/browse/MESOS-5107
             Project: Mesos
          Issue Type: Epic
          Components: stout
            Reporter: Michael Park


The current error handling mechanism is not sufficiently expressive in order to propagate typed error information.

Essentially we want to introduce {{Try<T, E>}} which becomes very similar to {{Result<T, E>}} in Rust.

We should also explore the inspection mechanism to handle the various cases. That is, whether we want to use the mechanism similar to continuation passing style used in {{Future}}, or if we want to use a {{switch}} style of inspection.

For example,

{code}
Try<int, Error> x = /* ... */;
x.ok([](int) { /* ... */ })
  .err([](const Error& error) { /* ... */ });
{code}

or

{code}
Try<int, Error> x = /* ... */;
match (x) (
  [](int) { /* ... */ },
  [](const Error&) { /* ... */ }
);
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)