mirror of
https://github.com/System-End/theseus.git
synced 2026-04-19 16:38:18 +00:00
event_id >_<
This commit is contained in:
parent
92ef482132
commit
9c9afb79b5
8 changed files with 9 additions and 9 deletions
|
|
@ -65,7 +65,7 @@ class BaseBatchesController < ApplicationController
|
|||
@batch.run_map!
|
||||
rescue StandardError => e
|
||||
Rails.logger.warn(e)
|
||||
event_id = Sentry.capture_exception(e)
|
||||
event_id = Sentry.capture_exception(e)&.event_id
|
||||
redirect_to send("#{@batch.class.name.split("::").first.downcase}_batch_path", @batch), flash: { alert: "error mapping fields! #{e.message} (error: #{event_id})" }
|
||||
return
|
||||
end
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ class Letter::BatchesController < BaseBatchesController
|
|||
|
||||
redirect_to letter_batch_path(@batch, print_now: letter_batch_params[:print_immediately]), notice: "Batch processed successfully"
|
||||
rescue => e
|
||||
event_id = Sentry.capture_exception(e)
|
||||
event_id = Sentry.capture_exception(e)&.event_id
|
||||
redirect_to process_letter_batch_path(@batch), alert: "Failed to process batch: #{e.message} (error: #{event_id})"
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ class SessionsController < ApplicationController
|
|||
@user = User.from_hack_club_auth(auth)
|
||||
rescue => e
|
||||
Rails.logger.error "Error creating user from Hack Club Auth: #{e.message}"
|
||||
event_id = Sentry.capture_exception(e)
|
||||
event_id = Sentry.capture_exception(e)&.event_id
|
||||
redirect_to login_path, alert: "error authenticating! (error: #{event_id})"
|
||||
return
|
||||
end
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ class Warehouse::BatchesController < BaseBatchesController
|
|||
@batch.run_map!
|
||||
rescue StandardError => e
|
||||
Rails.logger.warn(e)
|
||||
event_id = Sentry.capture_exception(e)
|
||||
event_id = Sentry.capture_exception(e)&.event_id
|
||||
redirect_to warehouse_batch_path(@batch), flash: { alert: "Error mapping fields! #{e.message} (error: #{event_id})" }
|
||||
return
|
||||
end
|
||||
|
|
|
|||
|
|
@ -38,11 +38,11 @@ class Warehouse::OrdersController < ApplicationController
|
|||
begin
|
||||
@warehouse_order.dispatch!
|
||||
rescue Zenventory::ZenventoryError => e
|
||||
event_id = Sentry.capture_exception(e)
|
||||
event_id = Sentry.capture_exception(e)&.event_id
|
||||
redirect_to @warehouse_order, alert: "zenventory said \"#{e.message}\" (error: #{event_id})"
|
||||
return
|
||||
rescue AASM::InvalidTransition => e
|
||||
event_id = Sentry.capture_exception(e)
|
||||
event_id = Sentry.capture_exception(e)&.event_id
|
||||
redirect_to @warehouse_order, alert: "couldn't dispatch order! wrong state? (error: #{event_id})"
|
||||
return
|
||||
end
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ module SnailMail
|
|||
pdf.image io, at: [x, y], width: size, height: size
|
||||
rescue => e
|
||||
Rails.logger.error("QR code generation failed: #{e.message}")
|
||||
event_id = Sentry.capture_exception(e)
|
||||
event_id = Sentry.capture_exception(e)&.event_id
|
||||
pdf.text_box "QR Error (error: #{event_id})", at: [x, y], width: size, height: size
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ class Warehouse::Batch < Batch
|
|||
begin
|
||||
Zenventory.create_customer_order(update_hash)
|
||||
rescue Zenventory::ZenventoryError => e
|
||||
event_id = Sentry.capture_exception(e)
|
||||
event_id = Sentry.capture_exception(e)&.event_id
|
||||
errors.add(:base, "couldn't create order, Zenventory said: #{e.message} (error: #{event_id})")
|
||||
throw(:abort)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -173,7 +173,7 @@ class Warehouse::Order < ApplicationRecord
|
|||
}.compact_blank
|
||||
Zenventory.update_customer_order(zenventory_id, update_hash) unless update_hash.empty?
|
||||
rescue Zenventory::ZenventoryError => e
|
||||
event_id = Sentry.capture_exception(e)
|
||||
event_id = Sentry.capture_exception(e)&.event_id
|
||||
errors.add(:base, "couldn't edit order, Zenventory said: #{e.message} (error: #{event_id})")
|
||||
throw(:abort)
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue