Skip to content

Commit

Permalink
application_trace
Browse files Browse the repository at this point in the history
  • Loading branch information
dalink committed Nov 16, 2024
1 parent 6b85074 commit 509752f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/error_notifier/middleware.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def notify_error(env, exception)
webhook_event: {
# name: "error",
error: exception.message,
# backtrace: exception.backtrace,
application_trace: application_trace(exception),
method: env["REQUEST_METHOD"],
path: env["PATH_INFO"],
params: request.params
Expand All @@ -42,5 +42,9 @@ def send_webhook(error_details)
error_details.to_json
)
end

def application_trace(exception)
exception.backtrace.select { |line| line.include?(Rails.root.to_s) }
end
end
end

0 comments on commit 509752f

Please sign in to comment.