Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

133
Vistas
How to return custom error from API Gateway

I have a Lambda application integrated with API Gateway, and I want to return this response body in the case of 409 error (conflict exception)

{
  "message": "some error message",
  "someObject": {
    "propert1": "val1"
  }
}

But according to this documentation https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Response.html#error-property, the error object doesn't expose deserialized data from service, except for message. Hence, in my JavaScript application, I only have an access to message property: "some error message", but I need to access someObject. How can I solve this? Do I need to serialize the object and bind it to message property?

I am using REST API and in Lambda we use javax.ws.rs.core.Response to return a response

data class Error(val message: String, val someObject: SomeDataClass)
...
val error = Error('message', someObject)
return Response.status(code).entity(error).build()
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda