error.rs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. use thiserror::Error as ThisError;
  2. pub type Result<T, E = Error> = std::result::Result<T, E>;
  3. #[derive(ThisError, Debug)]
  4. pub enum Error {
  5. #[error("No event to progress")]
  6. NoEvent,
  7. #[error("Out of compute credits")]
  8. OutOfCredits,
  9. /// Used when errors need to propogate but are too unique to be typed
  10. #[error("{0}")]
  11. Unique(String),
  12. #[error("GraphQL error: {0}")]
  13. GraphQL(String),
  14. // TODO(haze): Remove, or make a better error. This is pretty much useless
  15. #[error("GraphQL response mismatch. Got {found} but expected {expected}")]
  16. GraphQLMisMatch {
  17. expected: &'static str,
  18. found: String,
  19. },
  20. #[error("Difference detected in SystemTime! {0}")]
  21. SystemTime(#[from] std::time::SystemTimeError),
  22. #[error("Failed to parse Integer")]
  23. ParseInt(#[from] std::num::ParseIntError),
  24. #[error("")]
  25. MissingAuthentication,
  26. #[error("Failed to create experiment run: {0}")]
  27. FailedToCreateExperimentRun(String),
  28. #[error("Could not find shared behavior with ID {0}")]
  29. MissingSharedBehavior(String),
  30. #[error("I/O Error: {0}")]
  31. IO(#[from] std::io::Error),
  32. }