Skip to content

Commit

Permalink
extend undefined parser reporting (#503)
Browse files Browse the repository at this point in the history
The purpose is to help in troubleshooting the issue, and suggest that the problem is most probably related to one of the three parameters.

Co-authored-by: Lorenzo Mangani <lorenzo.mangani@gmail.com>
  • Loading branch information
shimaore and lmangani authored May 23, 2024
1 parent 52d9c5d commit 40c4104
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion parsers.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ const parsers = {
const parser = find(parsers._parsers, [contentType, req.routeOptions.method, req.routeOptions.url]) ||
find(parsers._parsers, ['*', req.routeOptions.method, req.routeOptions.url])
if (!parser) {
throw new Error('undefined parser')
throw new Error(`undefined parser for ${contentType} ${req.routeOptions.method} ${req.routeOptions.url}`)
}
return await parser(req, payload)
},
Expand Down

0 comments on commit 40c4104

Please sign in to comment.