This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

A client for reporting exceptions to errbit.

Installation

pip install errbit_reporter

Usage

import errbit_reporter as errbit

config = errbit.Configuration(
    api_key='491b8cbb777b051df1406ae0bcdbee2c',
    errbit_url='http://errbit.yourserver.com')

client = errbit.Client(config)
with client.notify_on_exception():
    your_code_here()

To avoid sending exceptions in development, just use None for the errbit_url. For example:

config = errbit.Configuration(
    api_key='491b8cbb777b051df1406ae0bcdbee2c',
    errbit_url=None,
    environment_name='development')

Additional context can be provided for the error. For example:

context = {
    'request_url': 'http://example.com/account/signup',
    'component': 'AccountController',
    'action': 'signup',
    'params': {
        'user': {
            'name': 'dylan'
        }
    },
    'cgi_data': {
        'REQUEST_METHOD': 'POST',
        'HTTP_USER_AGENT': 'curl'
    },
    'session' {
        'session_id': '6df95c0296cee016fb672af9310667e24dca066909a723dd6439369bb82911f3'
    }
}
with client.notify_on_exception(**context):
    your_code_here()

A notice can also be sent without a context manager to get notice metadata which can be used to log the errbit notice url.

try:
    your_code_here()
except:
    notice_metadata = client.notify()
    print(notice_metadata.url)

By default the exception information is taken from sys.exc_info(), but exc_info can also be passed as the first parameter, and additional context can be provided using the same keyword arguments as notify_on_exception.

In a distributed system (e.g. Spark) it is useful to be able to specify the backtrace manually. For example, this the backtrace could consist of local and remote processes stack trace, even if the remote processes is written in another language.

exc_type, exc_value, exc_traceback = sys.exc_info()
backtrace = traceback.extract_tb(exc_traceback)
notice = errbit.Notice(config, exc_type.__name__, str(exc_value), backtrace)
client.send_notice(notice)

Test Suite

make test
Release History

Release History

0.0.3

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
errbit-reporter-0.0.3.tar.gz (5.7 kB) Copy SHA256 Checksum SHA256 Source Jul 18, 2014

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting