REnforce icon indicating copy to clipboard operation
REnforce copied to clipboard

We need better error handling

Open NivenT opened this issue 7 years ago • 0 comments

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

NivenT avatar Aug 03 '17 08:08 NivenT