Customize Gateway Websocket Error Event

0

Hi there, Is there any way to customize the object that the frontend receives in a websocket error event? Because we are receiving some errors that come as message in the action. Thank you.

jkg
已提问 3 个月前118 查看次数
1 回答
0

You can customize the error response in a websocket using api gateway's integration response. This allows you to define how errors are structured and what data they contain when they're sent to the frontend via websocket. You can configure the integration response to map specific error messages or attributes from Lambda or other backend services to the websocket error event payload.

  1. Integration response mapping -> Integration response and configure mapping templates which can be used to define error attributes such as status code, error message, headers etc

https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-integration-responses.html

profile pictureAWS
已回答 3 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则