Repository URL to install this package:
|
Version:
3.4.41 ▾
|
python3-dmapi
/
usr
/
lib
/
python3
/
dist-packages
/
dmapi
/
__pycache__
/
exception_wrapper.cpython-35.pyc
|
|---|
×] ã @ sî d d l Z d d l Z d d l m Z d d l Z d d l m Z d d l m Z d d l m
Z
d d l m Z d d l m Z e j
j Z d d Z e j d
d Z d d
Z d d d d d Z d d Z d d Z d S)é N)Úexcutils)Úbase)Ú exception)Úfields)Úrpc)Ú
safe_utilsc C s* t | | | | | t | | | d S)N)Ú#_emit_legacy_exception_notificationÚ&_emit_versioned_exception_notification)ÚnotifierÚcontextÚexÚ
function_nameÚargsÚsource© r ú9/usr/lib/python3/dist-packages/dmapi/exception_wrapper.pyÚ_emit_exception_notification s r c C s t j j | } t j d t j d | } t j d d d t j j
} t j d | d | d t j j
d | } | j | d S)
NÚhostr ÚobjectZcomputeÚactionÚ publisherÚ
event_typeZpriorityÚpayload)r ZExceptionPayloadÚfrom_exceptionr ZNotificationPublisherÚCONFr Z EventTyper ZNotificationActionZ EXCEPTIONZExceptionNotificationZNotificationPriorityÚERRORÚemit)r r r Zversioned_exception_payloadr r Znotificationr r r r s r c C s, t d | d | } | j | | | d S)Nr r )ÚdictÚerror)r
r r r
r r r r r r * s r c s f d d } | S)zThis decorator wraps a method to catch any exceptions that may
get thrown. It also optionally sends the exception to the notification
system.
c s. f d d } t j | S)Nc s¦ y | | | | SWn t k
r¡ } zh t j T sE r t | | | | } j } t pu | | | | Wd QRXWYd d } ~ Xn Xd S)N)Ú Exceptionr Zsave_and_reraise_exceptionÚ_get_call_dictÚ__name__r )Úselfr r ÚkwÚeÚ call_dictr
)ÚbinaryÚfÚget_notifierr
r r Úwrapped6 s
z.wrap_exception.<locals>.inner.<locals>.wrapped)Ú functoolsÚwraps)r' r) )r&