mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-04-21 05:06:29 +00:00
Catch more HTTP API errors
This commit is contained in:
@@ -93,9 +93,25 @@ impl ErrorResponse {
|
||||
details: details.into(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn bad_request<S: Into<String>>(details: S) -> Self {
|
||||
Self {
|
||||
kind: ErrorResponseKind::BadRequest,
|
||||
details: details.into(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn internal_error<S: Into<String>>(details: S) -> Self {
|
||||
Self {
|
||||
kind: ErrorResponseKind::InternalError,
|
||||
details: details.into(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
pub enum ErrorResponseKind {
|
||||
NotFound,
|
||||
BadRequest,
|
||||
InternalError,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user