This PR adds HTTP 404 - Not Found error handlers to the Teams and Attacks blueprints. If a user has directly navigated to an attack or team that does not exist, the 'object_not_found.html' template is displayed:
If a request for an invalid attack or team does have a referrer set, the error handler will redirect back to the referring page and display an error toast popup:
I chose to implement both behaviors because it seemed frustrating to make users that clicked a broken link in the UI navigate back to where they came from, but users that clicked a link from outside the site that led to a non-existent page would not see a toast error. It would be trivial to adopt one approach over the other, or to introduce other types of error handlers.
Ref Issue #119
This PR adds HTTP 404 - Not Found error handlers to the Teams and Attacks blueprints. If a user has directly navigated to an attack or team that does not exist, the 'object_not_found.html' template is displayed:
If a request for an invalid attack or team does have a referrer set, the error handler will redirect back to the referring page and display an error toast popup:
I chose to implement both behaviors because it seemed frustrating to make users that clicked a broken link in the UI navigate back to where they came from, but users that clicked a link from outside the site that led to a non-existent page would not see a toast error. It would be trivial to adopt one approach over the other, or to introduce other types of error handlers.