#451·warp

Unreasonably hard to recover internal errors from Rejection.

Author: tobzCreated Feb 19, 2020Updated Sep 10, 2025

At present, for any custom recovery method, a user is forced to manually call Rejection::find for every possible internal error if they want to be able to properly shuttle back a suitable response for internal errors as well as their own errors.

It would be incredibly useful if we could simply expose the internal status code for a rejection that it would otherwise assign when handling rejections using the default error handler. This unlocks more than enough (namely, being able to call StatusCode::canonical_reason) as the hard work has already been mapping the known errors to a suitable HTTP status code.

Given that you actually deprecated/removed the ability to do this, can you add some color as to the why and could we talk about either bringing it back or some other solution that doesn't involve a ton of boilerplate?