TechnionYP5777 / Bugquery

Bug query
9 stars 1 forks source link

Error Controller for the Website #50

Closed yosefraisman closed 7 years ago

yosefraisman commented 7 years ago

Replace the default Whitelabel Error Page ("This application has no explicit mapping for /error, so you are seeing this as a fallback.") with custom error pages (e.g., a page for the ResourceNotFoundException thrown by the SearchController when it gets an invalid id). See Exception Handling in Spring MVC. ~No milestone yet (we'll discuss it in our meeting).~

yossigil commented 7 years ago

Milestone?

yosefraisman commented 7 years ago

Added a milestone, in accordance with today's meeting.

yosefraisman commented 7 years ago

localhost-8080-stacks-14

Implemented successfully. The error page displays the Exception, and has a javascript "Show Trace" button, which loads the stack (if it's available). It looks like this:

localhost-8080-stacks-16

Errors with user-friendly messages (like the missing search ID exception, throw new ResourceNotFoundException("Search id \"" + id + "\" could not be found.");, thrown in the search controller), will render like this:

localhost-8080-stacks-42

AdiOmari commented 7 years ago

Nice @yosefraisman, really nice!