Skip to main content

Decorator for catching exception and print them nicely.

Project description

Excptr

Decorator for catching exception and print them nicely

[Production-Development]

Installation

pip install excptr-karjakak

Usage

@excp()
def ...


@excpcls()
class ...

Example

Filename caller: /USERS/__MAIN__.PY


ERROR - <func_name>:
-----------------------------------------------------------------------
Start at:


line 26 in <module>:
    print(x.func_name(1, 3, '4'))


Filename: /USERS/EXCPTR.PY


line 111 in trac:
    if fn := f(*args, **kwargs):


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<- Exception raise: TypeError ->
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


line 11 in addall:
    return(sum(args))


TypeError: unsupported operand type(s) for +: 'int' and 'str'
----------------------------------------------------------------------

Note

  • There are 3 types of format:
    • -1 (by default) -> raise an exception
    • 0 -> print exception in logical order and nicely
    • 1 -> show exception in gui tkinter
      • Viewing limited in total of 60 seconds
    • 2 -> for logging the tracing to a file
      • If you choose 2, please give filename path
      • By default filename is None and if not given filename path, it will be defaulted back to -1 (raise exception)
      • Can use default user_path/dir/file
        • Create default dir function available

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

excptr-karjakak-0.2.5.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

excptr_karjakak-0.2.5-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file excptr-karjakak-0.2.5.tar.gz.

File metadata

  • Download URL: excptr-karjakak-0.2.5.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.2

File hashes

Hashes for excptr-karjakak-0.2.5.tar.gz
Algorithm Hash digest
SHA256 73453bc6c3a6ee62e24a90c90144b0635155fa07c678ccde41cb603439e9f411
MD5 fa967194a5ae43caa8447a865d44d3c1
BLAKE2b-256 ed145ad7264d38c9c2378c89094bd9268cec72a34d9001b73f6e91518a48d511

See more details on using hashes here.

File details

Details for the file excptr_karjakak-0.2.5-py3-none-any.whl.

File metadata

  • Download URL: excptr_karjakak-0.2.5-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.2

File hashes

Hashes for excptr_karjakak-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 c0d5bb415cb7f4f18c50ebc5fa222c6e6cc24d5e55197aaba26b8efb3cc5b5da
MD5 6faacb54de0239dcd080b839593fe70e
BLAKE2b-256 a715eaa202cde79d5619fcfbc8e74c962eebdff713263346a5933cc54ba22d30

See more details on using hashes here.

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