Skip to content

Instantly share code, notes, and snippets.

@jotes
Last active October 30, 2015 15:33
Show Gist options
  • Save jotes/55e6b15d4b99a511bd65 to your computer and use it in GitHub Desktop.
Save jotes/55e6b15d4b99a511bd65 to your computer and use it in GitHub Desktop.
diff --git a/pontoon/base/errors.py b/pontoon/base/errors.py
index 6678096..a7e8e09 100644
--- a/pontoon/base/errors.py
+++ b/pontoon/base/errors.py
@@ -1,10 +1,13 @@
+import sys
from raygun4py import raygunprovider
from django.conf import settings
-def send_exception(exc_type, exc_value, tb):
+def send_exception(*exc_info):
"""
- Sends exception to supported provider, can be used as sys.excepthook.
+ Sends exception to supported provider. You can pass informations about exception like:
+ (type, value, traceback) as exc_infoor function will try to figure it out via sys.exc_info().
"""
- raygunprovider.RaygunSender(settings.RAYGUN4PY_API_KEY).send_exception(exc_info=(exc_type, exc_value, tb))
+ exc_info = exc_info or sys.exc_info()
+ raygunprovider.RaygunSender(settings.RAYGUN4PY_API_KEY).send_exception(exc_info=exc_info)
(END)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment