Skip to main content

Baiscally just an Exception class that retains traceback information

Project description

python2_wrapped__exception

This is basically an Exception class that would be used to wrap raised Exceptions.

The common use case is when one wants to present a custom exception class to a downstream caller.

One would typically do this:


try:
    doStuffTHatTHrowsAnException()
except Exception as e:
    raise MyCustomException(e.message)

However, the above code causes the execution stack at the time of the first exception to be lost.

The WrappedException allows us to do this:


try:
    doStuffTHatTHrowsAnException()
except Exception:
    WrappedException.throw()

Callers can now catch "WrappedException" and still have the original execution stack.

Alternatively, they can do this:


try:
    doStuffTHatTHrowsAnException()
except Exception as e:
    WrappedException(e.message, another_parameter, etc.).throw()

As WrappedException would typically be subclassed with a "business" 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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

wrap_exception-0.0.2-py2-none-any.whl (1.6 kB view details)

Uploaded Python 2

File details

Details for the file wrap_exception-0.0.2-py2-none-any.whl.

File metadata

  • Download URL: wrap_exception-0.0.2-py2-none-any.whl
  • Upload date:
  • Size: 1.6 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/44.1.0 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/2.7.16

File hashes

Hashes for wrap_exception-0.0.2-py2-none-any.whl
Algorithm Hash digest
SHA256 658bfa824aec7d063fae093121d050851eeb0e086d8be8317d27395f4eff2e43
MD5 4d52cb780439eb29b60fafb104e0641a
BLAKE2b-256 6319edd8c0a62919a7fd5a62fb48397b5ac62b864a1b241159dee6ab9d78a70e

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