mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-21 03:36:06 +00:00
Catch more HTTP API errors
This commit is contained in:
parent
44a42a177a
commit
aababf37a8
2 changed files with 36 additions and 31 deletions
|
|
@ -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,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue