1 réponse
- Le plus récent
- Le plus de votes
- La plupart des commentaires
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
répondu il y a 2 ans
Contenus pertinents
- demandé il y a un an
- demandé il y a 8 mois
- demandé il y a 2 mois
- AWS OFFICIELA mis à jour il y a 2 ans
- AWS OFFICIELA mis à jour il y a 10 mois
- AWS OFFICIELA mis à jour il y a un an
- AWS OFFICIELA mis à jour il y a 2 ans