From 40c4104cd675c8494f30824859410b773cfc0fb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Alnet?= Date: Thu, 23 May 2024 11:19:36 +0200 Subject: [PATCH] extend undefined parser reporting (#503) 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 --- parsers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parsers.js b/parsers.js index 036aa30c..6cd4da05 100644 --- a/parsers.js +++ b/parsers.js @@ -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) },