<s> """<STR_LIT>""" <EOL> from __future__ import absolute_import <EOL> from . vendor import six <EOL> class T1Error ( Exception ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , code , content ) : <EOL> self . code = code <EOL> self . message = content <EOL> super ( T1Error , self ) . __init__ ( content ) <EOL> def __str__ ( self ) : <EOL> return repr ( '<STR_LIT>' <EOL> . format ( code = self . code , msg = self . message ) ) <EOL> class ClientError ( T1Error ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , content , code = None ) : <EOL> super ( ClientError , self ) . __init__ ( code , content ) <EOL> def __str__ ( self ) : <EOL> return repr ( self . message ) <EOL> T1ClientError = ClientError <EOL> class APIError ( T1Error ) : <EOL> """<STR_LIT>""" <EOL> def __str__ ( self ) : <EOL> return repr ( '<STR_LIT>' . format ( code = self . code , msg = self . message ) ) <EOL> T1APIError = APIError <EOL> class AuthRequiredError ( APIError ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> class ValidationError ( APIError ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , code , content ) : <EOL> msg_list = [ '<STR_LIT>' . format ( error , val [ '<STR_LIT:code>' ] , val [ '<STR_LIT:error>' ] ) <EOL> for ( error , val ) in six . iteritems ( content ) ] <EOL> messages = [ code ] + msg_list <EOL> messages = '<STR_LIT:\n>' . join ( messages ) <EOL> super ( ValidationError , self ) . __init__ ( code , messages ) <EOL> def __str__ ( self ) : <EOL> return self . message <EOL> class NotFoundError ( APIError ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> class LoginError ( T1Error ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , code , content , credentials ) : <EOL> super ( LoginError , self ) . __init__ ( code , content ) <EOL> self . credentials = credentials <EOL> def __str__ ( self ) : <EOL> return repr ( '<STR_LIT>' . format ( self . code , self . message , <EOL> self . credentials ) ) <EOL> class ParserException ( Exception ) : <EOL> def __init__ ( self , caught ) : <EOL> self . caught = caught <EOL> STATUS_CODES = { <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT>' : True , <EOL> '<STR_LIT>' : NotFoundError , <EOL> '<STR_LIT>' : AuthRequiredError , <EOL> '<STR_LIT>' : AuthRequiredError , <EOL> '<STR_LIT:error>' : APIError , <EOL> '<STR_LIT>' : ClientError , <EOL> } </s>
