def __init__(self, http_error):
error_details = None<EOL>error_response = None<EOL>if http_error.fp:<EOL><INDENT>try:<EOL><INDENT>error_response = http_error.fp.read()<EOL>error_body = json.loads(error_response)<EOL>error_details = ['<STR_LIT>' % (detail['<STR_LIT:message>'], detail['<STR_LIT>'])<EOL>for detail in error_body['<STR_LIT:error>']['<STR_LIT>']]<EOL><DEDENT>except (ValueError, TypeError, KeyError):<EOL><INDENT>pass<EOL><DEDENT><DEDENT>if error_details:<EOL><INDENT>error_details_str = '<STR_LIT:U+002CU+0020>'.join(error_details)<EOL>error_message = ('<STR_LIT>'<EOL>'<STR_LIT>' % (http_error.code, http_error.reason,<EOL>http_error.filename, error_details_str))<EOL><DEDENT>else:<EOL><INDENT>error_message = ('<STR_LIT>'<EOL>'<STR_LIT>' % (http_error.code, http_error.reason,<EOL>http_error.filename,<EOL>error_response))<EOL><DEDENT>super(ServerRequestException, self).__init__(error_message)<EOL>
Create a ServerRequestException from a given urllib2.HTTPError.

        Args:
          http_error: The HTTPError that the ServerRequestException will be
            based on.