[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-08-26(UTC)"],[],[],null,["\u003cbr /\u003e\n\n2nd gen 1st gen \n\n\u003cbr /\u003e\n\nAutomatically reporting errors\n\nYou can emit an error from a function to\n[Error Reporting](https://cloud.google.com/error-reporting/docs) as shown below: \n\nNode.js \n\n // These WILL be reported to Error Reporting\n throw new Error('I failed you'); // Will cause a cold start if not caught \n https://github.com/GoogleCloudPlatform/nodejs-docs-samples/blob/03ab11d81ed1ccb58a489c7f7edef5d596b9df85/functions/helloworld/helloError/index.js#L29-L30\n\nPython \n\n @functions_framework.http\n def hello_error_1(request):\n # This WILL be reported to Error Reporting,\n # and WILL NOT show up in logs or\n # terminate the function.\n from google.cloud import error_reporting\n\n client = error_reporting.Client()\n\n try:\n raise RuntimeError(\"I failed you\")\n except RuntimeError:\n client.report_exception()\n\n # This WILL be reported to Error Reporting,\n # and WILL terminate the function\n raise RuntimeError(\"I failed you\")\n\n\n @functions_framework.http\n def hello_error_2(request):\n # These errors WILL NOT be reported to Error\n # Reporting, but will show up in logs.\n import logging\n import sys\n\n print(RuntimeError(\"I failed you (print to stdout)\"))\n logging.warning(RuntimeError(\"I failed you (logging.warning)\"))\n logging.error(RuntimeError(\"I failed you (logging.error)\"))\n sys.stderr.write(\"I failed you (sys.stderr.write)\\n\")\n\n # This is considered a successful execution and WILL NOT be reported\n # to Error Reporting, but the status code (500) WILL be logged.\n from flask import abort\n\n return abort(500)\n\n https://github.com/GoogleCloudPlatform/python-docs-samples/blob/2947b35a1923eb7b78c53897b3e6f8191d75ec3a/functions/helloworld/main.py#L231-L249\n\nIf you would like more fine-grained error reporting, you can use the [Error Reporting client\nlibraries](https://cloud.google.com/error-reporting/docs/reference/libraries).\n\nYou can view the reported errors in [Error Reporting](https://console.cloud.google.com/errors)\nin the Google Cloud console. You can also see the errors reported from a\nparticular function when you select it from the [list of functions](https://console.cloud.google.com/functions) in the Google Cloud console.\n\nUncaught exceptions produced by your function will appear in Error Reporting.\nNote that some types of uncaught exceptions (such as those thrown\nasynchronously) will cause a [cold\nstart](https://cloud.google.com/functions/docs/bestpractices/tips) to occur upon\na future function invocation. This increases the amount of time your function\nwill take to run.\n\nManually reporting errors\n\nSending to Cloud Logging\n\nThe `error` function from the Cloud Functions\n[logger](https://firebase.google.com/docs/reference/functions/firebase-functions.logger)\nSDK will report errors to both Cloud Logging and [Error Reporting](https://cloud.google.com/error-reporting/docs). To include more context from the error as [structured data](https://cloud.google.com/logging/docs/structured-logging), pass an error object as the second argument: \n\n } catch (err) {\n // Attach an error object as the second argument\n functions.logger.error(\n \"Unable to read quote from Firestore, sending default instead\",\n err\n );\n }"]]