Skip to content

Commit c2c1fbc

Browse files
committed
log exceptions
1 parent c0ed9b7 commit c2c1fbc

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

app/controllers/application_controller.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@ def not_found(exception = nil)
6060
# The idea here is to not remove the user from the website entirely just
6161
# because esdb has failed.
6262
def esdb_exception(exception = nil)
63+
if exception
64+
Rails.logger.error "YO ITS AN ESDB EXCEPTION"
65+
Rails.logger.error exception.message
66+
st = exception.backtrace.join("\n")
67+
Rails.logger.error st
68+
end
6369
object_name = case self
6470
when PlayersController then 'player'
6571
when MatchesController then 'match'
@@ -72,6 +78,12 @@ def esdb_exception(exception = nil)
7278
# The exception template has a minimal layout for itself to avoid triggering
7379
# the exception it was rendered for again.
7480
def exception(exception = nil)
81+
if exception
82+
Rails.logger.error "YO ITS AN EXCEPTION"
83+
Rails.logger.error exception.message
84+
st = exception.backtrace.join("\n")
85+
Rails.logger.error st
86+
end
7587
render 'exception', locals: {exception: exception}, status: 500, layout: false
7688
end
7789

0 commit comments

Comments
 (0)