Skip to content

Provide Full Error in Catcher for 500 #2957

@snoweuph

Description

@snoweuph

API Docs to Existing Functionality

https://api.rocket.rs/v0.5/rocket/catcher/trait.Handler

Problems with Existing Functionality

Currently the 500 Error Catcher; only gets the Status and &Request like any other Catcher.

The Problem is, that the status.reason() might only be a generic 500 Internal Server Error and not hold an actual stack trace.

This is annoying for development and a problem for production systems, where you want to store 500 with a full stack, for example to disk.

Suggested Changes

Instead of only returning a Generic 500 Error Message, return more Context about what caused a 500

Alternatives Considered

don't use Rockets Catchers, and instead built my own Global Catching system

Additional Context

Look at this:

 >> Matched: (hello) GET /theme
   >> Error rendering Tera template 'feature/theme/view': Failed to render 'feature/theme/view'
   >> Failed to render 'feature/theme/view'
   >> Macro `link_icon` is missing the argument `href`
   >> Template 'feature/theme/view' failed to render.
   >> Outcome: Error(500 Internal Server Error)

Clearly in such a Case a Catcher wants to know why a 500 was thrown.
In production to write it to disk, and in development to render a detailed error page.

System Checks

  • I do not believe that this suggestion can or should be implemented outside of Rocket.

  • I was unable to find a previous suggestion for this change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    suggestionA suggestion to change functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions