<s> class ShippoError ( Exception ) : <EOL> def __init__ ( self , message = None , http_body = None , http_status = None , <EOL> json_body = None ) : <EOL> super ( ShippoError , self ) . __init__ ( message ) <EOL> if http_body and hasattr ( http_body , '<STR_LIT>' ) : <EOL> try : <EOL> http_body = http_body . decode ( '<STR_LIT:utf-8>' ) <EOL> except : <EOL> http_body = ( '<STR_LIT>' <EOL> '<STR_LIT>' ) <EOL> self . http_body = http_body <EOL> self . http_status = http_status <EOL> self . json_body = json_body <EOL> class APIError ( ShippoError ) : <EOL> pass <EOL> class APIConnectionError ( ShippoError ) : <EOL> pass <EOL> class AddressError ( ShippoError ) : <EOL> def __init__ ( self , message , param , code , http_body = None , <EOL> http_status = None , json_body = None ) : <EOL> super ( AddressError , self ) . __init__ ( message , http_body , http_status , json_body ) <EOL> self . param = param <EOL> self . code = code <EOL> class InvalidRequestError ( ShippoError ) : <EOL> def __init__ ( self , message , param , http_body = None , <EOL> http_status = None , json_body = None ) : <EOL> super ( InvalidRequestError , self ) . __init__ ( <EOL> message , http_body , http_status , json_body ) <EOL> self . param = param <EOL> class AuthenticationError ( ShippoError ) : <EOL> pass </s>
