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 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南