Skip to content

Commit 52ed6ee

Browse files
author
molty3000
committed
docs: add onError hook to lifecycle hooks documentation
1 parent d3e8bcc commit 52ed6ee

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

docs/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,11 @@ module.exports.handler = serverless(service)
201201
onResponse (req, res, stream) {
202202
// do some post-processing here
203203
// ...
204+
},
205+
onError (err, req, res) {
206+
// called when the request pipeline throws (e.g., onRequest error, proxy failure)
207+
// hook failures are silently caught — the original error still propagates to the client
208+
// can be sync or async
204209
}
205210

206211
// if proxyType= 'http', other options allowed https://www.npmjs.com/package/fast-proxy-lite#opts

0 commit comments

Comments
 (0)