This commit is contained in:
2026-01-03 00:44:20 -05:00
parent 791518eb3d
commit f8ea1fb4f7
6 changed files with 36 additions and 4 deletions

View File

@@ -23,6 +23,8 @@ pub enum HttpServerResultError {
PanelUuidNotFound { uuid: Uuid },
#[error(transparent)]
Command(#[from] crate::command::error::Error),
#[error("Command Not Found: {cmd}")]
CmdNotFound { cmd: String },
}
impl ResponseError for HttpServerResultError {
@@ -36,6 +38,7 @@ impl ResponseError for HttpServerResultError {
HttpServerResultError::InternalError { .. } => StatusCode::INTERNAL_SERVER_ERROR,
HttpServerResultError::PanelUuidNotFound { .. } => StatusCode::NOT_FOUND,
HttpServerResultError::Command(inner) => inner.status_code(),
HttpServerResultError::CmdNotFound { .. } => StatusCode::NOT_FOUND,
}
}
fn error_response(&self) -> HttpResponse {