我正在使用此端点运行一个简单的 Node Express 服务器
app.get('/', (req, res) => {
res.send("Success!");
});
当我在本地或通过 App Engine 运行此服务器并联系端点时,我收到预期的响应“成功!”。
为了确保我可以收到错误消息,我将端点更改为
app.get('/', (req, res) => {
throw new Error("A useful error message")
});
Error: A useful error message
当我在本地运行此服务器并联系端点时,我按预期收到了消息。但是当我使用 App Engine 运行服务器并联系端点时,我会收到消息Internal Server Error
。有没有办法让应用引擎返回我从服务器抛出的特定错误消息?