event id...

This commit is contained in:
24c02 2026-01-30 14:40:55 -05:00
parent 08c7840c3f
commit b3250abcc7
3 changed files with 6 additions and 5 deletions

View file

@ -45,8 +45,8 @@ module API
def handle_error(exception) def handle_error(exception)
raise exception if Rails.env.local? raise exception if Rails.env.local?
event_id = Sentry.capture_exception(exception) event = Sentry.capture_exception(exception)
render json: { error: exception.message, error_id: event_id }, status: :internal_server_error render json: { error: exception.message, error_id: event&.event_id }, status: :internal_server_error
end end
end end
end end

View file

@ -38,7 +38,8 @@ class ApplicationController < ActionController::Base
def handle_error(exception) def handle_error(exception)
raise exception if Rails.env.local? raise exception if Rails.env.local?
event_id = Sentry.capture_exception(exception) event = Sentry.capture_exception(exception)
event_id = event&.event_id
respond_to do |format| respond_to do |format|
format.html do format.html do

View file

@ -35,8 +35,8 @@ class UploadsController < ApplicationController
redirect_to uploads_path, notice: "File uploaded successfully!" redirect_to uploads_path, notice: "File uploaded successfully!"
rescue StandardError => e rescue StandardError => e
event_id = Sentry.capture_exception(e) event = Sentry.capture_exception(e)
redirect_to uploads_path, alert: "Upload failed: #{e.message} (Error ID: #{event_id})" redirect_to uploads_path, alert: "Upload failed: #{e.message} (Error ID: #{event&.event_id})"
end end
def destroy def destroy