Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stack trace logged after calling code has already handled the exception. #1086

Closed
mukund-ananthu opened this issue Feb 22, 2024 · 0 comments · Fixed by #1087
Closed

Stack trace logged after calling code has already handled the exception. #1086

mukund-ananthu opened this issue Feb 22, 2024 · 0 comments · Fixed by #1087
Assignees
Labels
api: pubsub Issues related to the googleapis/python-pubsub API.

Comments

@mukund-ananthu
Copy link
Contributor

Steps to reproduce

Run the code example provided on a valid topic and project.

Code example

from google.cloud import pubsub_v1
from google.api_core.exceptions import InvalidArgument

publisher = pubsub_v1.PublisherClient()
topic_path = publisher.topic_path(
    "project-id", "topic-name"
)
payload = b"test-message"

try:
  future = publisher.publish(
      topic=topic_path,
      data=payload,
  )

  print(future.result())
except InvalidArgument:
  print("Caught error: Message failed schema validation")

Stack trace

Caught error: Message failed schema validation
Failed to publish 1 messages.
Traceback (most recent call last):
... rest of traceback
@product-auto-label product-auto-label bot added the api: pubsub Issues related to the googleapis/python-pubsub API. label Feb 22, 2024
@mukund-ananthu mukund-ananthu changed the title Stack trace logged after calling code has already handled the exception. fix: Stack trace logged after calling code has already handled the exception. Feb 22, 2024
@mukund-ananthu mukund-ananthu changed the title fix: Stack trace logged after calling code has already handled the exception. Stack trace logged after calling code has already handled the exception. Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: pubsub Issues related to the googleapis/python-pubsub API.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant