hugapi / hug

Embrace the APIs of the future. Hug aims to make developing APIs as simple as possible, but no simpler.
MIT License
6.86k stars 388 forks source link

Add exception in not_found router #888

Open ptitpoulpe opened 3 years ago

ptitpoulpe commented 3 years ago

Issue

Currently, if an endpoint raised a HTTPNotFound exception it’s catched (see here), so you cannot have custom HTTPNotFound exception.

Solution

Pass the exception to not_found handlers so they can use the raised HTTPNotFound exception to generate not found message.