Skip to content
Clone

refactor(issues): refresh issues error types

zhenyi committed
parent 3607185 commit 502c35e Browse files

1 file changed

+2 −8

Modified lib/issues/error.rs View lib/issues/error.rs
@@ -1,7 +1,6 @@
1use axum::Json;
21use axum::http::StatusCode;
32use axum::response::{IntoResponse, Response};
4use serde::Serialize;
3use export::data::{AppResponseData, NoData};
54use thiserror::Error;
65
76pub type IssueResult<T> = Result<T, IssueError>;
@@ -77,11 +76,6 @@
7776 | IssueError::RateLimited(_)
7877 )
7978 }
80}
81
82#[derive(Serialize)]
83struct ErrorBody<'a> {
84 error: &'a str,
8579}
8680
8781impl IntoResponse for IssueError {
@@ -93,6 +87,6 @@
9387 tracing::error!(error = %self, "issues internal error");
9488 "internal error".to_string()
9589 };
96 (status, Json(ErrorBody { error: &msg })).into_response()
90 AppResponseData::<NoData>::err_plain(status.as_u16() as i32, msg).into_response()
9791 }
9892}
No newline at end of file