Skip to content

Commit

Permalink
Update Sources/swift-openapi-generator/Documentation.docc/Proposals/S…
Browse files Browse the repository at this point in the history
…OAR-0011.md

Co-authored-by: Honza Dvorsky <[email protected]>
  • Loading branch information
gayathrisairam and czechboy0 authored Sep 18, 2024
1 parent 205d78c commit 09bd716
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ introduces a way for users to map errors thrown by their handlers to specific HT

### Motivation

When implementing a server with Swift OpenAPI Generator, users implement a type that conforms to a generated protocol, providing one method for each API operation defined in the OpenAPI document. At runtime, if this function throws, the runtime library transforms this into a 500 HTTP response (Internal Error).
When implementing a server with Swift OpenAPI Generator, users implement a type that conforms to a generated protocol, providing one method for each API operation defined in the OpenAPI document. At runtime, if this function throws, it's up to the server transport to transform it into an HTTP response status code – for example, some transport use `500 Internal Error`.

Instead, server developers may want to map errors thrown by the application to a more specific HTTP response.
Currently, this can be achieved by checking for each error type in each handler's catch block, converting it to an
Expand Down

0 comments on commit 09bd716

Please sign in to comment.