wearepal / landscapes

2 stars 1 forks source link

add rescue statements to controllers #397

Closed olliethomas closed 4 months ago

olliethomas commented 4 months ago

because the following Fatal error was raised

F, [2024-07-22T12:45:52.324755 #1] FATAL -- : [474f408e-5fc1-42d2-9caf-2ad3d3b3621c]
[474f408e-5fc1-42d2-9caf-2ad3d3b3621c] ActiveRecord::RecordNotFound (Couldn't find LabellingGroup with 'id'=134):
[474f408e-5fc1-42d2-9caf-2ad3d3b3621c]
[474f408e-5fc1-42d2-9caf-2ad3d3b3621c] app/controllers/labelling_groups_controller.rb:13:in `show'
- Gracefully stopping, waiting for requests to finish
Exiting

this PR adds mostly chatgpt-generated rescue statements to catch the above error (and similar ones), showing an alert and navigating to the root_url rather than crashing