File: //home/arjun/projects/env/lib/python3.10/site-packages/sqlalchemy/__pycache__/exc.cpython-310.pyc
o
#we|R � @ s d Z ddlmZ ddlmZ dZG dd� de�ZG dd� dee�ZG d d
� d
e�Z G dd� de �Z
G d
d� de �ZG dd� de �ZG dd� de �Z
G dd� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd � d e�ZG d!d"� d"e�ZG d#d$� d$e�ZG d%d&� d&e�ZG d'd(� d(e�ZG d)d*� d*ee�ZG d+d,� d,e�ZG d-d.� d.e�ZG d/d0� d0e�ZG d1d2� d2e�ZG d3d4� d4e�ZG d5d6� d6e�Z G d7d8� d8e�Z!G d9d:� d:e�Z"G d;d<� d<e�Z#G d=d>� d>e�Z$G d?d@� d@e�Z%G dAdB� dBe�Z&G dCdD� dDe&�Z'G dEdF� dFe'�Z(G dGdH� dHe'�Z)G dIdJ� dJe)�Z*G dKdL� dLe)�Z+G dMdN� dNe)�Z,G dOdP� dPe)�Z-G dQdR� dRe)�Z.G dSdT� dTe)�Z/G dUdV� dVee0�Z1G dWdX� dXe1�Z2G dYdZ� dZe2�Z3G d[d\� d\e2�Z4G d]d^� d^e4�Z5G d_d`� d`e6�Z7G dadb� dbee8�Z9dS )cz�Exceptions used with SQLAlchemy.
The base exception class is :exc:`.SQLAlchemyError`. Exceptions which are
raised as a result of DBAPI exceptions are all subclasses of
:exc:`.DBAPIError`.
� )�
_preloaded)�compatNc s8 e Zd ZdZdZ� fdd�Zdd� Z� fdd�Z� ZS ) �HasDescriptionCodezDhelper which adds 'code' as an attribute and '_code_str' as a methodNc s4 |� dd �}|d ur
|| _tt| �j|i |�� d S )N�code)�popr �superr �__init__)�self�arg�kwr �� __class__� �G/home/arjun/projects/env/lib/python3.10/site-packages/sqlalchemy/exc.pyr s zHasDescriptionCode.__init__c C s | j sdS dt| j f S )N� z:(Background on this error at: https://sqlalche.me/e/%s/%s))r �_version_token�r r r r � _code_str! s ���zHasDescriptionCode._code_strc s( t t| ��� }| jrd|| �� f }|S �Nz%s %s)r r �__str__r r )r �messager r r r . s zHasDescriptionCode.__str__) �__name__�
__module__�__qualname__�__doc__r r r r �
__classcell__r r r r r s
r c @ s6 e Zd ZdZejfdd�Zdd� Zdd� Zdd � Z d
S )�SQLAlchemyErrorzGeneric error class.c C sf t | j�dkr.| jd }|rt|tj�rt�|d�}|S tjs!|s't|�}|S t�|�}|S t| j�S )Nr � zutf-8) �len�args�
isinstancer �binary_types�decode_backslashreplace�py3k�str� text_type)r �
as_unicode�textr r r �_message8 s
�
�
zSQLAlchemyError._messagec C s$ | � |�}| jrd|| �� f }|S r )r( r r )r r&