Repository URL to install this package:
|
Version:
4.3.1.2-4.3 ▾
|
python3-tvault-contego
/
usr
/
lib
/
python3.6
/
site-packages
/
contego
/
__pycache__
/
exception.cpython-36.opt-1.pyc
|
|---|
3
ÒƜeÈ ã @ sp d Z ddlmZmZ yddlmZ W n ek
rD ddlmZ Y nX ddl Z ddl
mZ eje
Zdd ZG d d
d
eZG dd deZG d
d deZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZG dd d eZG d!d" d"eZG d#d$ d$eZG d%d& d&eZG d'd( d(eZ dS ))z"Contego base exception handling.
é )Ú_Ú_LE)Úlogé N)Úexcutilsc C s dd } | 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 fdd}t j |S )Nc sj y | |f||S t k
rd } z6tj " j}tjdjt|| W d Q R X W Y d d }~X nX d S )Nz)Error occurred: {} when running {} method)Ú Exceptionr Zsave_and_reraise_exceptionÚ__name__ÚLOGÚ exceptionÚformatÚstr)ÚselfÚcontextÚargsÚkwÚexcZ
function_name)Úf© ú/usr/lib/python3.6/exception.pyÚwrapped s
z.wrap_exception.<locals>.inner.<locals>.wrapped)Ú functoolsÚwraps)r r r )r r Úinner s zwrap_exception.<locals>.innerr )r r r r Úwrap_exception s r c s2 e Zd ZdZdZdZi ZdZd fdd Z Z S ) ÚContegoExceptionzÎBase Contego Exception
To correctly use this class, inherit from it and define
a 'message' property. That message will get printf'd
with the keyword arguments provided to the constructor.
zError: %(reason)siô FNc sª || _ d| j kr6y| j| j d<