mirror of
https://github.com/System-End/cdn.git
synced 2026-04-19 15:18:15 +00:00
event id...
This commit is contained in:
parent
08c7840c3f
commit
b3250abcc7
3 changed files with 6 additions and 5 deletions
|
|
@ -45,8 +45,8 @@ module API
|
|||
def handle_error(exception)
|
||||
raise exception if Rails.env.local?
|
||||
|
||||
event_id = Sentry.capture_exception(exception)
|
||||
render json: { error: exception.message, error_id: event_id }, status: :internal_server_error
|
||||
event = Sentry.capture_exception(exception)
|
||||
render json: { error: exception.message, error_id: event&.event_id }, status: :internal_server_error
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -38,7 +38,8 @@ class ApplicationController < ActionController::Base
|
|||
def handle_error(exception)
|
||||
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|
|
||||
format.html do
|
||||
|
|
|
|||
|
|
@ -35,8 +35,8 @@ class UploadsController < ApplicationController
|
|||
|
||||
redirect_to uploads_path, notice: "File uploaded successfully!"
|
||||
rescue StandardError => e
|
||||
event_id = Sentry.capture_exception(e)
|
||||
redirect_to uploads_path, alert: "Upload failed: #{e.message} (Error ID: #{event_id})"
|
||||
event = Sentry.capture_exception(e)
|
||||
redirect_to uploads_path, alert: "Upload failed: #{e.message} (Error ID: #{event&.event_id})"
|
||||
end
|
||||
|
||||
def destroy
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue