app/controllers/reactive_record/reactive_record_controller.rb
Avoid rescuing the Exception
class. Perhaps you meant to rescue StandardError
? Open
Open
rescue Exception => e
render json: {error: e.message, backtrace: e.backtrace}, status: 500
- Read upRead up
- Exclude checks
This cop checks for rescue blocks targeting the Exception class.
Example:
# bad
begin
do_something
rescue Exception
handle_exception
end
Example:
# good
begin
do_something
rescue ArgumentError
handle_exception
end
Avoid rescuing the Exception
class. Perhaps you meant to rescue StandardError
? Open
Open
rescue Exception => e
render json: {error: e.message, backtrace: e.backtrace}, status: 500
- Read upRead up
- Exclude checks
This cop checks for rescue blocks targeting the Exception class.
Example:
# bad
begin
do_something
rescue Exception
handle_exception
end
Example:
# good
begin
do_something
rescue ArgumentError
handle_exception
end
Avoid rescuing the Exception
class. Perhaps you meant to rescue StandardError
? Open
Open
rescue Exception => e
render json: {error: e.message, backtrace: e.backtrace}, status: 500
- Read upRead up
- Exclude checks
This cop checks for rescue blocks targeting the Exception class.
Example:
# bad
begin
do_something
rescue Exception
handle_exception
end
Example:
# good
begin
do_something
rescue ArgumentError
handle_exception
end