<s> class RequestError ( RuntimeError ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , wrapped ) : <EOL> self . wrapped = wrapped <EOL> RuntimeError . __init__ ( self ) <EOL> class AbortError ( Exception ) : <EOL> pass <EOL> class TransportError ( Exception ) : <EOL> pass <EOL> class ParameterError ( TransportError ) : <EOL> pass <EOL> class ResponseError ( TransportError ) : <EOL> def __init__ ( self , url , proxy , errcode , reason , headers = None ) : <EOL> TransportError . __init__ ( self , url , proxy , errcode , reason ) <EOL> self . url = url <EOL> self . proxy = proxy <EOL> self . errcode = errcode <EOL> self . reason = reason <EOL> self . headers = headers <EOL> def __str__ ( self ) : <EOL> if self . proxy : <EOL> via = "<STR_LIT>" % ( self . proxy . scheme , self . proxy . hostport , ) <EOL> else : <EOL> via = "<STR_LIT>" <EOL> safe_url = str ( self . url ) <EOL> if hasattr ( safe_url , '<STR_LIT>' ) : <EOL> safe_url = safe_url . __safe_str__ ( ) <EOL> return "<STR_LIT>" % ( safe_url , via , self . errcode , <EOL> self . reason ) <EOL> def splitSocketError ( error ) : <EOL> """<STR_LIT>""" <EOL> if len ( error . args ) > <NUM_LIT:1> : <EOL> msg = error [ <NUM_LIT:1> ] <EOL> args = ( error [ <NUM_LIT:0> ] , ) <EOL> else : <EOL> msg = error [ <NUM_LIT:0> ] <EOL> args = ( ) <EOL> return args , msg </s>
