Skip to main content

Exception formatter that produces readable stack traces.

Project description

dexc

This Python project is an exception formatter that produces readable stack traces.

It only supports Python 3.12 and later.

Features

Current features

  • Context displayed in addition to the trace line of each frame
  • Reversed frame order i.e. JavaScript-like
  • Truncated trace lines when there are too many
  • Colorized stack trace obeying the the NO_COLOR environment variable
  • Minimzed frames when those are not part of the user code
  • Support for exception groups
  • Highlighting of re-raises i.e. when an exception is caught and re-raised with more than a simple raise, causing two stack traces to be concatenated without separation
  • Formatting of unraisable exceptions e.g. raised in a destructor
  • Support for syntax errors

Future features

  • Better checks e.g. when the column number is not available but the line number is
  • Improve support for exception groups
  • User vs lib tb kinds
  • Avoid repeating recursive calls e.g. infinite loop
  • Maximum screen width
  • Option to reverse order
  • Better highlight re-raises
  • More ast nodes supported
  • More precise ast node targeting e.g. should work if all statements are on the same line
  • Handle multiprocessing.pool.RemoteTraceback which currently is text
  • Better highlighting using ast data (e.g. only highlight first line of for loop)
  • Formatting of exceptions raised in threads
  • Better handling of file paths e.g. site-packages
  • Perhaps syntax highlighting
  • Avoid highlighting large nodes e.g. highlight a function and parentheses instead of the arguments if the function call is failing
  • Other escape codes e.g. curly underlines or clickable file names
  • Other characters

Installation

$ pip install dexc

Usage

import dexc
dexc.install()

Prior art

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

dexc-0.1.0.tar.gz (5.2 kB view hashes)

Uploaded Source

Built Distribution

dexc-0.1.0-py3-none-any.whl (5.7 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