Skip to main content

Get nicely formated exception details

Project description

exception_details

Get nicely formated exception details.

Content

  • Installation

  • Usage

Installation

pip install exception-details

Usage

  • print_exception_details(exception: Exception)

    Print the exception details.

    Usage:

      `try: ...`  
    
      `except Exception as e: print_exception_details(e)`  
    

    Contains:

    • function name

    • filepath

    • line

    • code snippet

    • species of the exception

    • message

    Args:

      exception (Exception): Your Exception
    
  • get_exception_details_dict(exception: Exception)

    Get the exception details as a dictionary.

    Usage:

      `try: ... `  
    
      `except Exception as e: details = get_exception_details_dict(e)`  
    

    Contains:

    • 'function' -> function name

    • 'path' -> filepath

    • 'line' -> line

    • 'code' -> code snippet

    • 'species' -> species of the exception

    • 'message' -> message

    Args:

      exception (Exception): Your Exception
    

    Returns:

      dict: Exception details as a dictionary with the keys: "function", "path", "line", "code", "species", "message"
    
  • get_exception_details_str(exception: Exception, colored=True)

    Print the exception details.

    Usage:

      `try: ... `  
    
      `except Exception as e: details = get_exception_details_str(e)`  
    

    Contains:

    • function name

    • filepath

    • line

    • code snippet

    • species of the exception

    • message

    Args:

      exception (Exception): Your Exception
    
      colored (boolean): The string has coloreds parts if True.
    

    Returns:

      str: Exception details as a string."
    

Links

GitHub | PyPI

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

exception_details-0.0.3.tar.gz (23.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

exception_details-0.0.3-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file exception_details-0.0.3.tar.gz.

File metadata

  • Download URL: exception_details-0.0.3.tar.gz
  • Upload date:
  • Size: 23.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.14

File hashes

Hashes for exception_details-0.0.3.tar.gz
Algorithm Hash digest
SHA256 226c0e3a76c60d68f3337d6cfb3fa366730ba10dd695259c6d6afc1f13f38364
MD5 8f79863262cd4685d6d54b9a63d3f5c1
BLAKE2b-256 8636d119a71fd240faaf924a4d491b46f7b31e11db53511501ed8fe5c1eaab42

See more details on using hashes here.

File details

Details for the file exception_details-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for exception_details-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 0de15b028b8512a006b1749dfa0547ada45d6c7bbc6ee3b1677f0b6f9fa64afb
MD5 ed56d6ab5ae1ae9ef0cf18860396708a
BLAKE2b-256 e33c58a715bc915cbcb622a770076e155a3be85d9c9ef93c0f55266e8de859af

See more details on using hashes here.

Supported by

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