awpak_rs/services/error.rs
1
2#[derive(Debug)]
3pub enum Error
4{
5 EndpointNotFound( String ),
6 EndpointExecution( String ),
7 ParserError( String ),
8 RegexError( String )
9}
10
11impl Error
12{
13 pub fn get_status_code( &self ) -> u16
14 {
15 match self
16 {
17 Error::EndpointNotFound( _ ) => 404,
18 _ => 500
19 }
20 }
21}