add backend for history
This commit is contained in:
@@ -9,14 +9,20 @@ pub enum WebsocketResponseError {}
|
||||
|
||||
#[derive(Error, Debug)]
|
||||
pub enum HttpServerResultError {
|
||||
#[error("Telemetry Not Found: {tlm}")]
|
||||
TlmNotFound { tlm: String },
|
||||
#[error("Telemetry Name Not Found: {tlm}")]
|
||||
TlmNameNotFound { tlm: String },
|
||||
#[error("Telemetry Uuid Not Found: {uuid}")]
|
||||
TlmUuidNotFound { uuid: String },
|
||||
#[error("DateTime Parsing Error: {date_time}")]
|
||||
InvalidDateTime { date_time: String },
|
||||
}
|
||||
|
||||
impl ResponseError for HttpServerResultError {
|
||||
fn status_code(&self) -> StatusCode {
|
||||
match *self {
|
||||
HttpServerResultError::TlmNotFound { .. } => StatusCode::NOT_FOUND,
|
||||
HttpServerResultError::TlmNameNotFound { .. } => StatusCode::NOT_FOUND,
|
||||
HttpServerResultError::TlmUuidNotFound { .. } => StatusCode::NOT_FOUND,
|
||||
HttpServerResultError::InvalidDateTime { .. } => StatusCode::BAD_REQUEST,
|
||||
}
|
||||
}
|
||||
fn error_response(&self) -> HttpResponse {
|
||||
|
||||
Reference in New Issue
Block a user