15 lines
268 B
Rust
15 lines
268 B
Rust
|
|
use axum::http::StatusCode;
|
||
|
|
use serde::Serialize;
|
||
|
|
|
||
|
|
#[derive(Serialize)]
|
||
|
|
pub struct CommonResp {
|
||
|
|
pub code: i64,
|
||
|
|
}
|
||
|
|
|
||
|
|
pub fn internal_error<E>(err: E) -> (StatusCode, String)
|
||
|
|
where
|
||
|
|
E: std::error::Error,
|
||
|
|
{
|
||
|
|
(StatusCode::INTERNAL_SERVER_ERROR, err.to_string())
|
||
|
|
}
|