def index(request): try: 1 / 0 except Exception as exception: airbrake = Client() airbrake.notify(exception, request) return HttpResponse("Hello, world. You're at the index.")
class AirbrakeNotifierMiddleware(object): def __init__(self): self.client = Client() def process_exception(self, request, exception): if hasattr(settings, 'AIRBRAKE') and not settings.AIRBRAKE.get('DISABLE', False): self.client.notify(exception=exception, request=request)
class AirbrakeNotifierMiddleware(object): def __init__(self): self.client = Client() def process_exception(self, request, exception): if not settings.DEBUG: self.client.notify(exception=exception, request=request)
def __inner__(*args, **kwargs): try: f(*args, **kwargs) except Exception as e: from airbrake.utils.client import Client c = Client() c.notify(exception=e) raise e
class AirbrakeNotifierMiddleware(MiddlewareMixin): def __init__(self, *args, **kwargs): self.client = Client() super(AirbrakeNotifierMiddleware, self).__init__(*args, **kwargs) def process_exception(self, request, exception): if hasattr(settings, 'AIRBRAKE') and not settings.AIRBRAKE.get('DISABLE', False): self.client.notify(exception=exception, request=request)
def __inner__(*args, **kwargs): try: f(*args, **kwargs) except Exception, e: from airbrake.utils.client import Client c = Client() c.notify(exception=e) raise e
class AirbrakeNotifierMiddleware(object): def __init__(self): self.client = Client() def process_exception(self, request, exception): self.client.notify(exception=exception, request=request)