GoogleCloudPlatform / GoogleCloudPlatform/functions-framework-python

Error handler for async functions

未关闭
#401 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
enhancement P2
主要语言
Python
星标
968
派生
128
PR 合并指标
30 天内没有已合并 PR

描述

Hello!

The README shows a [error handler](https://github.com/GoogleCloudPlatform/functions-framework-python/blob/a07b1e4f81d84424189488022e5f3d59c06014cc/examples/cloud_run_async/README.md) for the standard functions framework.

```py
import functions_framework

@functions_framework.errorhandler(ZeroDivisionError)
def handle_zero_division(e):
return "I'm a teapot", 418

def function(request):
1 / 0
return "Success", 200
```

Is there something similar available for the newer [async functions](https://github.com/GoogleCloudPlatform/functions-framework-python/blob/a07b1e4f81d84424189488022e5f3d59c06014cc/examples/cloud_run_async/README.md)?

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。