Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions functions/helloworld/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,17 @@ def hello_method(request):

def hello_error_1(request):
# [START functions_helloworld_error]
# This WILL be reported to Stackdriver Error
# Reporting, and WILL NOT show up in logs or
# terminate the function.
from google.cloud import error_reporting
client = error_reporting.Client()

try:
raise RuntimeError('I failed you')
except RuntimeError:
client.report_exception()

# This WILL be reported to Stackdriver Error Reporting,
# and WILL terminate the function
raise RuntimeError('I failed you')
Expand Down
1 change: 1 addition & 0 deletions functions/helloworld/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
google-cloud-error-reporting==0.30.0