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)

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.1.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

excptr_karjakak-0.2.1-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: excptr-karjakak-0.2.1.tar.gz
  • Upload date:
  • Size: 3.8 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.1.tar.gz
Algorithm Hash digest
SHA256 959b9aa34fedf0129bc609942f2e619ad78ba2fd708e96733853be091c501036
MD5 eb73d79a17c2d26b657dfc77de482ffb
BLAKE2b-256 bcd3dc3c66007c679a4d82853e7ad1efd92608bc5839d534b60cacc9f0a613a1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: excptr_karjakak-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 4.2 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f03e4f4912a03e37ce9b1f0a5bf7257b47800a2e1171f6913002b39a5dfd23d1
MD5 77d069024e98e64f074ec2205e0ae923
BLAKE2b-256 608e2675c957fca4a79b028c36e7593b13996e8ea0d22e89964ddb2e99909d40

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