Python

Introduction

Before integrating a new BugSplat SDK with your application, make sure to review the Getting Started resources and complete the simple startup tasks listed below.
  • Sign up for a BugSplat account
  • Log in using your email address
  • Create a new database for your application
Need any further help? Check out the full BugSplat documentation here, or email the team at [email protected].

bugsplat-py

A BugSplat integration for reporting Unhandled Exceptions in Python.

Installing

Install the bugsplat package using pip
1
pip install bugsplat
Copied!

Usage

Import the BugSplat class
1
from bugsplat import BugSplat
Copied!
Create a new BugSplat instance passing it the name of your BugSplat database, application, and version
1
bugsplat = BugSplat(database, application, version)
Copied!
Optionally, you set default values for key, description, email, user, and additionaFilePaths
1
bugsplat.setDefaultAppKey('key!')
2
bugsplat.setDefaultDescription('description!')
3
bugsplat.setDefaultEmail('[email protected]')
4
bugsplat.setDefaultUser('Fred')
5
bugsplat.setDefaultAdditionalFilePaths([
6
'./path/to/additional-file.txt',
7
'./path/to/additional-file-2.txt'
8
])
Copied!
Wrap your application code in a try/except block. In the except block call post. You can override any of the default properties that were set in step 3
1
try:
2
crash()
3
except Exception as e:
4
bugsplat.post(e, additionalFilePaths=[], appKey='other key!', description='other description!', email='[email protected]', user='Barney')
Copied!
Once you've posted a crash, navigate to the Crashes page and click the link in the ID column to see the crash's details
BugSplat Python Crash
Thanks for using BugSplat ❤️
Last modified 24d ago