Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

We need better error handling #3

Open
NivenT opened this issue Aug 3, 2017 · 0 comments
Open

We need better error handling #3

NivenT opened this issue Aug 3, 2017 · 0 comments

Comments

@NivenT
Copy link
Owner

NivenT commented Aug 3, 2017

How I currently envision this working is by making a custom error type, and then having most user-facing functions return Results. I like how rusty-machine has their error type set up, so I imagine doing something similar. Something like

use std::error::Error;

struct RError {
  reason: Reason,
  err: Box<Error>
}

enum Reason {
  Unknown,
  InvalidAction,
  EnvWarning,     // issue with environment, wait a bit then try again
  EnvFatal,       // environment is dead...
  blah
}

If you're curious about the EnvWarning/Fatal reasons, see #1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant