19 lines
529 B
Rust
19 lines
529 B
Rust
#[derive(Debug)]
|
|
pub enum ServerError {
|
|
PermissionDeniedForPrivilegedPort,
|
|
PermissionDenied,
|
|
Unknown,
|
|
}
|
|
|
|
impl ServerError {
|
|
pub fn description(&self) -> &str {
|
|
match self {
|
|
Self::PermissionDeniedForPrivilegedPort => {
|
|
"Could not start server on a privileged port due to insufficient permissions"
|
|
}
|
|
Self::PermissionDenied => "Action failed due to insufficient permissions",
|
|
Self::Unknown => "An unknown error has occurred",
|
|
}
|
|
}
|
|
}
|