def map_unreachable_exception(e):
 exception_class = FacebookUnreachable
 if isinstance(e, ssl.SSLError):
  exception_class = FacebookSSLError
 elif isinstance(e, HTTPError):
  exception_class = FacebookHTTPError
 elif isinstance(e, URLError):
  exception_class = FacebookURLError
 return exception_class

def map_unreachable_exception ( e ) : exception_class = FacebookUnreachable if isinstance ( e , ssl . SSLError ) : exception_class = FacebookSSLError elif isinstance ( e , HTTPError ) : exception_class = FacebookHTTPError elif isinstance ( e , URLError ) : exception_class = FacebookURLError return exception_class
we always raise the original and new subclass to - preserve backwards compatibility .