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
asked 3 months ago107 views
1 Answer
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
answered 3 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions