Repository URL to install this package:
|
Version:
6.0.24-6.0 ▾
|
python3-tvault-contego-el9
/
usr
/
lib
/
python3.9
/
site-packages
/
contego
/
__pycache__
/
exception.cpython-39.pyc
|
|---|
a
JrgY ã @ s d Z ddlmZmZ zddlmZ W n eyB ddlmZ Y n0 ddl Z ddl
mZ e e
¡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 G d)d* d*eZ!G 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 ¡|S )Nc s z | |g|¢R i |¤W S t y } zPt ¡ , j}t d t||¡¡ W d n1 sd0 Y W Y d }~n
d }~0 0 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© ú5/usr/lib/python3.9/site-packages/contego/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 vr4z| j| j d<