081669be91450696c05a31521060227897ad4658
This is a useful decorator for writing a simple function to filter or translate exceptions based on criteria more complex than simply the (super)class (i.e. in situations that aren't amenable to being handled by simply matching subclasses with Python's exception handling syntax). For example, this can be used to filter on the HTTP status code from a generic client exception. Unlike a naive implementation at the point of need or using contextlib to create a reusable context manager, using this library class also makes it easy to ensure that any exceptions that are re-raised (not filtered) retain the same traceback. Change-Id: Ib986ccaf95a19ef14fef1cebe39fc87c17c2769f
oslo.utils
The oslo.utils library provides support for common utility type functions, such as encoding, exception handling, string manipulation, and time handling.
- Free software: Apache license
- Documentation: http://docs.openstack.org/developer/oslo.utils
- Source: http://git.openstack.org/cgit/openstack/oslo.utils
- Bugs: http://bugs.launchpad.net/oslo.utils
Description
Languages
Python
100%