From a7a92a4049dd54e8e02e74e77600ac5facb79295 Mon Sep 17 00:00:00 2001 From: Stephane Alnet Date: Thu, 2 May 2024 16:57:20 +0200 Subject: [PATCH] extend undefined parser reporting The purpose is to help in troubleshooting the issue, and suggest that the problem is most probably related to one of the three parameters. --- 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) },