
    K.h
                    r    d dl mZ d dlZd dlZd dlmZ d dlmZ  G d de          Z	 G d de          Z
dS )	    )annotationsN)Any)Responsec                  .    e Zd ZdZ	 	 	 	 	 dddZddZdS )	JIRAErrorzAGeneral error raised for all problems in operation of the client.Ntext
str | Nonestatus_code
int | NoneurlrequestResponse | Noneresponsec                    || _         || _        || _        || _        || _        |                    dd          | _        dt          j        v | _	        dt          j        v | _
        dS )a  Creates a JIRAError.

        Args:
            text (Optional[str]): Message for the error.
            status_code (Optional[int]): Status code for the error.
            url (Optional[str]): Url related to the error.
            request (Optional[requests.Response]): Request made related to the error.
            response (Optional[requests.Response]): Response received related to the error.
            **kwargs: Will be used to get request headers.
        headersNPYJIRA_LOG_TO_TEMPFILEGITHUB_ACTION)r
   r   r   r   r   getr   osenvironlog_to_tempfileci_run)selfr   r
   r   r   r   kwargss          a/Users/user/workspace/sujinbaek/cqa-test-app/venv/lib/python3.11/site-packages/jira/exceptions.py__init__zJIRAError.__init__   s^    & '	 zz)T2272:E%3    returnstrc                   d| j          }| j        r|d| j         z  }d}| j        Nt          | j        d          r|d| j        j         z  }t          | j        d          r|d| j        j         z  }| j        Nt          | j        d          r|d| j        j         z  }t          | j        d          r|d	| j        j         z  }| j        r_t          j	        d
d          \  }}t          |d          5 }|d| z  }|                    |           d d d            n# 1 swxY w Y   n| j        r|d| j         z  }|d| z  }|S )NzJiraError HTTP z url:  r   z
	request headers = r   z
	request text = z
	response headers = z
	response text = z.tmpz
jiraerror-)suffixprefixwz
 details: z
	text: z
	)r
   r   r   hasattrr   r   r   r   tempfilemkstempopenwrite)r   tdetails_	file_namefs         r   __str__zJIRAError.__str__)   s   0d.008 	%$$($$$A<#t|Y// KJDL4HJJJt|V,, ED1BDDD=$t}i00 MLT]5JLLLt}f-- GF$-2DFFF 
	"#+6,OOOLAyi%% !-)---   ! ! ! ! ! ! ! ! ! ! ! ! ! ! !
 y .-$)---!!!!As   ;D%%D),D))NNNNN)
r   r	   r
   r   r   r	   r   r   r   r   )r   r   )__name__
__module____qualname____doc__r   r/    r   r   r   r   
   sX        KK  "&#'$(4 4 4 4 48     r   r   c                  $     e Zd ZdZd fdZ xZS )NotJIRAInstanceErrorz4Raised in the case an object is not a JIRA instance.instancer   c                h    d|j         j         }t                                          |           d S )NzUThe first argument of this function must be an instance of type JIRA. Instance Type: )	__class__r0   superr   )r   r7   msgr9   s      r   r   zNotJIRAInstanceError.__init__N   sC    B$,$6$?B B 	 	r   )r7   r   )r0   r1   r2   r3   r   __classcell__)r9   s   @r   r6   r6   K   sC        >>         r   r6   )
__future__r   r   r&   typingr   requestsr   	Exceptionr   r6   r4   r   r   <module>rA      s    " " " " " " 				             > > > > >	 > > >B    9     r   