Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

AttributeError: 'str' object has no attribute '_credentials'  #3071

Copy link
Copy link
@kevmo314

Description

@kevmo314
Issue body actions

Hi, I'm trying the example code and it's failing with the following exception:

>>> c = error_reporting.Client(project='<my-project-str>')
>>> try:
...   raise NameError
... except Exception:
...   c.report_exception()
...
Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
NameError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 4, in <module>
  File "/opt/python/3.6.0/lib/python3.6/site-packages/google/cloud/error_reporting/client.py", line 348, in report_exception
    user=user)
  File "/opt/python/3.6.0/lib/python3.6/site-packages/google/cloud/error_reporting/client.py", line 277, in _send_error_report
    self.report_errors_api.report_error_event(error_report)
  File "/opt/python/3.6.0/lib/python3.6/site-packages/google/cloud/error_reporting/client.py", line 162, in report_errors_api
    self._report_errors_api = make_report_error_api(self._project)
  File "/opt/python/3.6.0/lib/python3.6/site-packages/google/cloud/error_reporting/_gax.py", line 39, in make_report_error_api
    client._credentials,
AttributeError: 'str' object has no attribute '_credentials'

Reading the source, this seems like a rather obvious error:

https://github.com/GoogleCloudPlatform/google-cloud-python/blob/master/error_reporting/google/cloud/error_reporting/client.py#L162

self._project is a string and at https://github.com/GoogleCloudPlatform/google-cloud-python/blob/master/error_reporting/google/cloud/error_reporting/_gax.py#L29 it's treated like a client object. Is this not the case?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.