Skip to content

Commit 02b33c2

Browse files
committed
Rescue StandardError in v2 BaseApiController
Rescuing from Exception would also catch system-level exceptions, which would likely be taking things too far (e.g. system-level errors like `Interrupt` and `SystemExit`). StandardError covers all application-level errors while still ensuring clients get consistent JSON responses.
1 parent 062e9c4 commit 02b33c2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

app/controllers/api/v2/base_api_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class BaseApiController < ApplicationController # rubocop:todo Style/Documentati
1919
# set up pages in response
2020
before_action :pagination_params, except: %i[heartbeat]
2121

22-
rescue_from Exception, with: :handle_exception
22+
rescue_from StandardError, with: :handle_exception
2323

2424
# GET /api/v2/heartbeat
2525
def heartbeat

0 commit comments

Comments
 (0)