Skip to content
Permalink
Browse files

Fix missing ticket configuration error handling

- Return 503 due to serialization error of http-api-problem when using in conjunction with 204
  • Loading branch information...
schrieveslaach committed Feb 26, 2019
1 parent f01d6a1 commit f188098a6b7ac6d5ce641b1f725f1c36f6f4938d
Showing with 7 additions and 3 deletions.
  1. +6 −2 api/res/openapi.yml
  2. +1 −1 api/src/tickets.rs
@@ -45,14 +45,18 @@ paths:
properties:
"^[a-zA-Z0-9_-]":
$ref: '#/components/schemas/Ticket'
'204':
description: 'No ticket system configuration'
'500':
description: Server error
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
'503':
description: 'No ticket system configuration'
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
/apps/{appName}:
post:
summary: Start or update a new review app.
@@ -113,7 +113,7 @@ pub enum ListTicketsError {
impl From<ListTicketsError> for HttpApiProblem {
fn from(error: ListTicketsError) -> Self {
let status = match error {
ListTicketsError::MissingIssueTrackingConfiguration => StatusCode::NO_CONTENT,
ListTicketsError::MissingIssueTrackingConfiguration => StatusCode::SERVICE_UNAVAILABLE,
ListTicketsError::UnexpectedError {
internal_message: _,
} => StatusCode::INTERNAL_SERVER_ERROR,

0 comments on commit f188098

Please sign in to comment.
You can’t perform that action at this time.