-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Improve Error handling, consistent logging and sentry/ rollbar
Imrpoves debugging experience
- Loading branch information
1 parent
6ca2cec
commit f4a885d
Showing
5 changed files
with
24 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# frozen_string_literal: true | ||
|
||
module Box | ||
module Helpers | ||
module ErrorHandler | ||
def log_error(exception, logger_prefix: "generic") | ||
Sentry.capture_exception(exception) if ENV["SENTRY_DSN"] | ||
Rollbar.error(exception) if ENV["ROLLBAR_ACCESS_TOKEN"] | ||
Box.logger.error("[#{logger_prefix}] #{exception.class} :: \"#{exception.message}\"") | ||
end | ||
end | ||
end | ||
end |