Skip to content

Commit 30a4c61

Browse files
add respond_to? in order to log any exception (#238)
1 parent 012e787 commit 30a4c61

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/controllers/avo/application_controller.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def exception_logger(exception)
1818
respond_to do |format|
1919
format.html { raise exception }
2020
format.json { render json: {
21-
errors: exception.record.present? ? exception.record.errors : [],
21+
errors: exception.respond_to?(:record) && exception.record.present? ? exception.record.errors : [],
2222
message: exception.message,
2323
traces: exception.backtrace,
2424
}, status: ActionDispatch::ExceptionWrapper.status_code_for_exception(exception.class.name) }

0 commit comments

Comments
 (0)