diff options
| author | mo khan <mo@mokhan.ca> | 2014-02-22 09:06:00 -0700 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2014-02-22 09:06:00 -0700 |
| commit | 89b64a44f269bb6dfe68cdff8a168ee2a04ee9d6 (patch) | |
| tree | 207133f4f90b4f53a07b9c03bb4b7d47c664616f /app | |
| parent | 42a7b9e904f304de6f1a1b399de2868a3fc045c7 (diff) | |
add global error handler to respond with internal server error.
Diffstat (limited to 'app')
| -rw-r--r-- | app/controllers/application_controller.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 658a065..1b2f9f7 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -3,9 +3,17 @@ class ApplicationController < ActionController::Base # For APIs, you may want to use :null_session instead. protect_from_forgery with: :null_session before_filter :load_additional_payload_data + rescue_from StandardError, with: :return_server_error + def load_additional_payload_data @license_statuses = LicenseStatus::ALL @well_types = WellType::ALL end + + private + + def return_server_error + render nothing: true, status: :internal_server_error + end end |
