<s> """<STR_LIT>""" <EOL> import json <EOL> import re <EOL> class FacebookError ( Exception ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> class FacebookRequestError ( FacebookError ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( <EOL> self , message , <EOL> request_context , <EOL> http_status , <EOL> http_headers , <EOL> body <EOL> ) : <EOL> self . _message = message <EOL> self . _request_context = request_context <EOL> self . _http_status = http_status <EOL> self . _http_headers = http_headers <EOL> try : <EOL> self . _body = json . loads ( body ) <EOL> except ( TypeError , ValueError ) : <EOL> self . _body = body <EOL> self . _api_error_code = None <EOL> self . _api_error_type = None <EOL> self . _api_error_message = None <EOL> self . _api_blame_field_specs = None <EOL> self . _api_transient_error = False <EOL> if self . _body and '<STR_LIT:error>' in self . _body : <EOL> self . _error = self . _body [ '<STR_LIT:error>' ] <EOL> if '<STR_LIT:message>' in self . _error : <EOL> self . _api_error_message = self . _error [ '<STR_LIT:message>' ] <EOL> if '<STR_LIT:code>' in self . _error : <EOL> self . _api_error_code = self . _error [ '<STR_LIT:code>' ] <EOL> if '<STR_LIT>' in self . _error : <EOL> self . _api_transient_error = self . _error [ '<STR_LIT>' ] <EOL> if '<STR_LIT>' in self . _error : <EOL> self . _api_error_subcode = self . _error [ '<STR_LIT>' ] <EOL> if '<STR_LIT:type>' in self . _error : <EOL> self . _api_error_type = self . _error [ '<STR_LIT:type>' ] <EOL> if self . _error . get ( '<STR_LIT>' , { } ) . get ( '<STR_LIT>' ) : <EOL> self . _api_blame_field_specs = self . _error [ '<STR_LIT>' ] [ '<STR_LIT>' ] <EOL> else : <EOL> self . _error = None <EOL> request = self . _request_context <EOL> if '<STR_LIT>' in self . _request_context : <EOL> request = self . _request_context . copy ( ) <EOL> del request [ '<STR_LIT>' ] <EOL> super ( FacebookRequestError , self ) . __init__ ( <EOL> "<STR_LIT>" + <EOL> "<STR_LIT>" % self . _message + <EOL> "<STR_LIT>" % request . get ( '<STR_LIT>' ) + <EOL> "<STR_LIT>" % request . get ( '<STR_LIT:path>' , '<STR_LIT:/>' ) + <EOL> "<STR_LIT>" % request . get ( '<STR_LIT>' ) + <EOL> "<STR_LIT:\n>" + <EOL> "<STR_LIT>" % self . _http_status + <EOL> "<STR_LIT>" % re . sub ( <EOL> r"<STR_LIT:\n>" , "<STR_LIT>" , <EOL> json . dumps ( self . _body , indent = <NUM_LIT:2> ) <EOL> ) + <EOL> "<STR_LIT:\n>" <EOL> ) <EOL> def request_context ( self ) : <EOL> return self . _request_context <EOL> def http_status ( self ) : <EOL> return self . _http_status <EOL> def http_headers ( self ) : <EOL> return self . _http_headers <EOL> def body ( self ) : <EOL> return self . _body <EOL> def api_error_message ( self ) : <EOL> return self . _api_error_message <EOL> def api_error_code ( self ) : <EOL> return self . _api_error_code <EOL> def api_error_subcode ( self ) : <EOL> return self . _api_error_subcode <EOL> def api_error_type ( self ) : <EOL> return self . _api_error_type <EOL> def api_blame_field_specs ( self ) : <EOL> return self . _api_blame_field_specs <EOL> def api_transient_error ( self ) : <EOL> return self . _api_transient_error <EOL> def get_message ( self ) : <EOL> return self . _message <EOL> class FacebookBadObjectError ( FacebookError ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> class FacebookBadParameterError ( FacebookError ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> class FacebookUnavailablePropertyException ( FacebookError ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> class DocsmithSkipTestError ( Exception ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , message ) : <EOL> self . _message = message <EOL> def get_skip_error_msg ( self ) : <EOL> return self . _message <EOL> class FacebookBadParameterTypeException ( FacebookError ) : <EOL> """<STR_LIT>""" <EOL> pass </s>
