21 lines
512 B
Rust
21 lines
512 B
Rust
use std::io;
|
|
use std::string::FromUtf8Error;
|
|
|
|
use thiserror::Error;
|
|
|
|
#[derive(Debug, Error)]
|
|
pub enum Error {
|
|
#[error("Invalid op code '{0}'")]
|
|
InvalidOpCode(u16),
|
|
#[error("Invalid error code '{0}'")]
|
|
InvalidErrorCode(u16),
|
|
#[error("Invalid mode '{0}'")]
|
|
InvalidMode(String),
|
|
#[error("String contains invalid characters")]
|
|
InvalidString(#[from] FromUtf8Error),
|
|
#[error("Unterminated string")]
|
|
UnterminatedString,
|
|
#[error("Io error: {0}")]
|
|
Io(#[from] io::Error),
|
|
}
|