OSC / ondemand

Supercomputing. Seamlessly. Open, Interactive HPC Via the Web
https://openondemand.org/
MIT License
280 stars 104 forks source link

errors in custom widgets can produce 500 internal server error #3539

Open johrstrom opened 5 months ago

johrstrom commented 5 months ago

While debugging #3452 I found that the response Rails gives is actually 500.

Here are the error logs for reference.

App 391 output: [2024-04-30 19:33:25 +0000 ] FATAL "LoadError (cannot load such file -- sqlite3):\n  \napp/helpers/dashboard_helper.rb:43:in `render_widget'\napp/views/dashboard/index.html.erb:13\napp/views/dashboard/index.html.erb:12:in `each'\napp/views/dashboard/index.html.erb:12\napp/views/dashboard/index.html.erb:9:in `each'\napp/views/dashboard/index.html.erb:9\napp/views/dashboard/index.html.erb:7:in `each'\napp/views/dashboard/index.html.erb:7"
App 391 output: [2024-04-30 19:33:25 +0000 ]  INFO "method=GET path=/pun/sys/dashboard/500 format=html controller=ErrorsController action=internal_server_error status=500 allocations=8878 duration=8.74 view=6.19"

Instead of fatally crashing - we should just account for LoadErrors or other Exceptions.