protected IOException createException(InputStream response,int code,String status){
  if (isError(code)) {
    final RequestError error;
    try {
      error=parseError(response);
    }
 catch (    IOException e) {
      return e;
    }
    if (error != null)     return new RequestException(error,code);
  }
 else   try {
    response.close();
  }
 catch (  IOException ignored) {
  }
  String message;
  if (status != null && status.length() > 0)   message=status + " (" + code+ ')';
 else   message="Unknown error occurred (" + code + ')';
  return new IOException(message);
}

protected IOException createException ( InputStream response , int code , String status ) { if ( isError ( code ) ) { final RequestError error ; try { error = parseError ( response ) ; } catch ( IOException e ) { return e ; } if ( error != null ) return new RequestException ( error , code ) ; } else try { response . close ( ) ; } catch ( IOException ignored ) { } String message ; if ( status != null && status . length ( ) > 0 ) message = status + " (" + code + ')' ; else message = "Unknown error occurred (" + code + ')' ; return new IOException ( message ) ; }
create error exception from response and throw it
