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