The documentation for error_reporting.client.HTTPContext gives the wrong parameter names.
>>> from google.cloud import error_reporting
>>> client = error_reporting.Client()
>>> user = 'example@gmail.com'
>>> http_context = HTTPContext(method='GET', url='/', userAgent='test agent',
... referrer='example.com', responseStatusCode=500,
... remote_ip='1.2.3.4')
>>> try:
>>> raise NameError
>>> except Exception:
>>> client.report_exception(http_context=http_context, user=user))
Reading the code, it's clear that the camel-cased names are internally used to match expected JSON keys for the underlying API call, but the actual parameter names are properly snake-cased. Oddly, the docs do show the correct parameter name for remote_ip, but not user_agent or response_status_code.
I couldn't figure out which file to edit to fix, otherwise I would have just submitted a PR.
The documentation for
error_reporting.client.HTTPContextgives the wrong parameter names.Reading the code, it's clear that the camel-cased names are internally used to match expected JSON keys for the underlying API call, but the actual parameter names are properly snake-cased. Oddly, the docs do show the correct parameter name for
remote_ip, but notuser_agentorresponse_status_code.I couldn't figure out which file to edit to fix, otherwise I would have just submitted a PR.