Skip to main content

Better runtime error messages

Project description

frosch - Runtime Error Debugger

PyPI version Codecov

Better runtime error messages

Are you also constantly seeing the runtime error message the python interpreter is giving you? It lacks some color and more debug information!

Get some good looking error tracebacks and beautifuly formatted last line with all its last values before you crashed the program.

Installation

$ pip install frosch

Usage

Call the hook function at the beginning of your program.

from frosch import hook

hook()

x = 3 + "String"

Print Exceptions

You can also easily print your catched exceptions to stdout

from frosch import print_exception

try:
  x = [0, 1]
  x[3]
except IndexError as error:
  print_exception(error)

Configuration

Themes

frosch allows to use different themes for styling the output:

Themes
abap bw igor native rrt trac
algol colorful inkpot paraiso_dark sas vim
algol_nu default lovelace paraiso_light solarized vs
arduino emacs manni pastie stata_dark xcode
autumn friendly monokai perldoc stata_light
borland fruity murphy rainbow_dash tango

Usage:

from frosch import hook

hook(theme="vim")

OS Notifications

But wait there is more!

Running longer scripts in the background?

Just add a title and/or message to the hook and it will you give a notification when your program is crashing.

from frosch import hook

hook(
  theme="vs", # VSCode Theme
  title="I crashed!",
  message="Run Number #1444 is also crashing..."
)

This works on MacOS (osascript), Linux (notify-send) and Windows (powershell).

Contribution

frosch uses poetry for build and dependency management, so please install beforehand.

Setup

$ git clone https://github.com/HallerPatrick/frosch.git
$ poetry install

Run tests

$ python -m pytest tests

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

frosch-0.1.6.tar.gz (9.6 kB view hashes)

Uploaded Source

Built Distribution

frosch-0.1.6-py3-none-any.whl (9.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page