NivenT / REnforce

Reinforcement learning library written in Rust

Home Page:https://nivent.github.io/REnforce/renforce/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

We need better error handling

NivenT opened this issue · 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