Other changes for Tauri
This commit is contained in:
parent
99db087cf1
commit
fe04e17d63
6 changed files with 16 additions and 23 deletions
|
|
@ -11,6 +11,14 @@ pub struct ApiError {
|
|||
}
|
||||
|
||||
impl ApiError {
|
||||
pub fn new_from_string(status: StatusCode, text: String) -> Self {
|
||||
Self {
|
||||
status: Some(status),
|
||||
kind: ApiErrorKind::Other(anyhow::anyhow!("{}", text)),
|
||||
plaintext: false,
|
||||
}
|
||||
}
|
||||
|
||||
pub const fn torrent_not_found(torrent_id: usize) -> Self {
|
||||
Self {
|
||||
status: Some(StatusCode::NOT_FOUND),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue