1 Resposta
- Mais recentes
- Mais votos
- Mais comentários
0
Hi!
From the docs:
$util.appendError(String).
Appends a custom error. This can be used in request or response mapping templates if the template detects an error with the request or with the invocation result. Unlike $util.error(String), the template evaluation will not be interrupted, so that data can be returned to the caller.
In your case the else statement isn't actually returning a response, i think your response mapping template should use $utils.error helper instead:
#if($ctx.error) $util.error($ctx.error.message, $ctx.error.type) #end
#if($ctx.result.statusCode == 200) #set($body = $util.parseJson($ctx.result.body))
$util.toJson($body) #else $utils.error($ctx.result.body, $ctx.result.statusCode) #end
respondido há 2 anos
Conteúdo relevante
- AWS OFICIALAtualizada há um ano
- AWS OFICIALAtualizada há um ano
- AWS OFICIALAtualizada há 2 anos
- AWS OFICIALAtualizada há um ano