Skip to content

Commit c3411a1

Browse files
authored
docs for error mapping
1 parent 36a96b1 commit c3411a1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,13 @@ exports.handler = router.handler(
4848
}
4949
],
5050
debug: true,
51+
// custom mapping of thrown errors to http response code error:
52+
// the action can throw an object like
53+
// "throw {reason: 'NotFound', message: 'object id not found'}"
54+
// the http response then contains the configured value as response code and the message as the body
5155
errorMapping: {
5256
'NotFound': 404,
53-
'RequestError': 500
57+
'ServerError': 500
5458
}
5559
},
5660
// for handling calls initiated from AWS-SNS:

0 commit comments

Comments
 (0)