Sindbad~EG File Manager
3
��"h+ � @ s� d dl mZ G dd� de�ZG dd� de�ZG dd� de�ZG dd � d e�ZG d
d� de�ZG dd
� d
e�ZG dd� de�Z dd� Z
dS )� )� HTTPErrorc @ s e Zd Zddd�ZdS )�SafeExceptionWrapperNc C s || _ || _|| _d S )N)�inner�etype�details)�selfr r r � r �,/usr/libexec/kcare/python/kcarectl/errors.py�__init__ s zSafeExceptionWrapper.__init__)NN)�__name__�
__module__�__qualname__r
r r r r r s r c @ s e Zd ZdZdS )�
KcareErrorzwBase kernelcare exception which will be considered as expected
error and the full traceback will not be shown.
N)r r r
�__doc__r r r r r s r c @ s e Zd ZdS )�NotFoundN)r r r
r r r r r s r c @ s e Zd ZdS )�NoLibcareLicenseExceptionN)r r r
r r r r r s r c s$ e Zd Z� fdd�Zdd� Z� ZS )�AlreadyTrialedExceptionc s0 t t| �j||� |d|jd�� | _|| _d S )N� �T)�superr r
�index�created�ip)r r r �args�kwargs)� __class__r r r
s z AlreadyTrialedException.__init__c C s dj | j| j�S )Nz6The IP {0} was already used for a trial license on {1})�formatr r )r r r r �__str__% s zAlreadyTrialedException.__str__)r r r
r
r �
__classcell__r r )r r r s r c @ s e Zd Zdd� ZdS )�UnableToGetLicenseExceptionc C s t j| dt|� � d S )Nz6Unknown Issue when getting trial license. Error code: )� Exceptionr
�str)r �coder r r r
* s z$UnableToGetLicenseException.__init__N)r r r
r
r r r r r ) s r c @ s e Zd ZdS )�BadSignatureExceptionN)r r r
r r r r r# . s r# c s � fdd�}|S )Nc s
t | � �S )N)�
isinstance)�e�state)�exc_listr r r 3 s zcheck_exc.<locals>.innerr )r'