Skip to content

Commit

Permalink
default to plaintext errors
Browse files Browse the repository at this point in the history
  • Loading branch information
florimondmanca committed Dec 17, 2018
1 parent a8b6868 commit f6416b5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@ Bocadillo adheres to [Semantic Versioning](https://semver.org).
- Show Bocadillo version using `boca -v/-V/--version/version`.
- Built-in `HTTPError` handlers: `error_to_html`, `error_to_media`, `error_to_text`.

### Changed

- Exceptions raised in middleware callbacks were always handled by the HTML `HTTPError` handler. If configured, the one on the `API` will now be used instead.
- The default `HTTPError` handler now returns plaintext instead of HTML.

### Fixed

- Serving static files from a non-existing directory (including the default one) used to raise an invasive warning. It has been silenced.
- Exceptions raised in middleware callbacks were always handled by the HTML `HTTPError` handler. If configured, the one on the `API` will now be used instead.

### Removed

Expand Down
2 changes: 1 addition & 1 deletion bocadillo/error_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def convert_exception_to_response(
):
"""Wrap call to `dispatch()` to always return an HTTP response."""
if error_handler is None:
error_handler = error_to_html
error_handler = error_to_text

@wraps(dispatch)
async def inner(req: Request) -> Response:
Expand Down

0 comments on commit f6416b5

Please sign in to comment.