REnforce
REnforce copied to clipboard
We need better error handling
How I currently envision this working is by making a custom error type, and then having most user-facing functions return Result
s. 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