Skip to main content

oak_python/errors/
mod.rs

1use serde::{Deserialize, Serialize};
2
3#[derive(Copy, Clone, Debug, Serialize, Deserialize)]
4pub enum ParseError {
5    InvalidRequest,
6}
7
8impl ParseError {
9    pub fn new() -> Self {
10        Self::InvalidRequest
11    }
12}
13
14pub struct Fail {
15    pub error: ParseError,
16}
17
18impl Fail {
19    pub fn new(error: ParseError) -> Self {
20        Self { error }
21    }
22}
23
24pub struct PexError {
25    pub kind: PexErrorKind,
26}
27
28impl PexError {
29    pub fn new(kind: PexErrorKind) -> Self {
30        Self { kind }
31    }
32}
33
34pub enum PexErrorKind {
35    SyntaxError {},
36}
37
38impl PexErrorKind {
39    pub fn new_syntax_error() -> Self {
40        Self::SyntaxError {}
41    }
42}