We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 012e787 commit 30a4c61Copy full SHA for 30a4c61
app/controllers/avo/application_controller.rb
@@ -18,7 +18,7 @@ def exception_logger(exception)
18
respond_to do |format|
19
format.html { raise exception }
20
format.json { render json: {
21
- errors: exception.record.present? ? exception.record.errors : [],
+ errors: exception.respond_to?(:record) && exception.record.present? ? exception.record.errors : [],
22
message: exception.message,
23
traces: exception.backtrace,
24
}, status: ActionDispatch::ExceptionWrapper.status_code_for_exception(exception.class.name) }
0 commit comments