Skip to content

Commit

Permalink
add exception infos to payload
Browse files Browse the repository at this point in the history
  • Loading branch information
mjansing committed Jul 1, 2024
1 parent 1244ff1 commit 1af548f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions app/controllers/concerns/controller_extensions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,20 @@ module ControllerExtensions

protected

def append_info_to_payload(payload)
super

# not set by rails because we rescue exceptions using :handle_server_error
if @exception.present?
payload[:exception] = [@exception.class.name, @exception.message]
payload[:exception_object] = @exception
end

if current_user.present?
payload[:user_id] = current_user.id
end
end

def default_url_options(options = nil)
{ format: params[:format], lang: I18n.locale }.
merge(options || {})
Expand Down

0 comments on commit 1af548f

Please sign in to comment.