Skip to main content

juno/utils/
error.rs

1use std::fmt::*;
2
3#[derive(Debug)]
4pub enum Error {
5	Internal(String),
6	FromJuno(u32),
7}
8
9impl Display for Error {
10	fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
11		match self {
12			Error::Internal(string) => write!(f, "Module internal error: {}", string),
13			Error::FromJuno(num) => write!(f, "Juno error code: {}", num),
14		}
15	}
16}
17
18pub type Result<T> = std::result::Result<T, Error>;