pinakes-server: add utoipa annotations to all routes; fix tests
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I28cf5b7b7cff8e90e123d624d97cf9656a6a6964
This commit is contained in:
parent
8bde7f8fc2
commit
625077f341
60 changed files with 3493 additions and 242 deletions
|
|
@ -44,6 +44,25 @@ impl IntoResponse for ApiError {
|
|||
PinakesError::InvalidOperation(msg) => {
|
||||
(StatusCode::BAD_REQUEST, msg.clone())
|
||||
},
|
||||
PinakesError::InvalidLanguageCode(code) => {
|
||||
(
|
||||
StatusCode::BAD_REQUEST,
|
||||
format!("invalid language code: {code}"),
|
||||
)
|
||||
},
|
||||
PinakesError::SubtitleTrackNotFound { index } => {
|
||||
(
|
||||
StatusCode::NOT_FOUND,
|
||||
format!("subtitle track {index} not found in media"),
|
||||
)
|
||||
},
|
||||
PinakesError::ExternalTool { tool, .. } => {
|
||||
tracing::error!(tool = %tool, error = %self.0, "external tool failed");
|
||||
(
|
||||
StatusCode::INTERNAL_SERVER_ERROR,
|
||||
format!("external tool `{tool}` failed"),
|
||||
)
|
||||
},
|
||||
PinakesError::Authentication(msg) => {
|
||||
(StatusCode::UNAUTHORIZED, msg.clone())
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue