Skip to content

Commit

Permalink
improve error handling for missing/mistyped route mappings
Browse files Browse the repository at this point in the history
  • Loading branch information
Carmine DiMascio committed Apr 19, 2020
1 parent fac5e2a commit c3aaa62
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "express-openapi-validator",
"version": "3.12.1",
"version": "3.12.2",
"description": "Automatically validate API requests and responses with OpenAPI 3 and Express.",
"main": "dist/index.js",
"scripts": {
Expand Down
3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,9 @@ export class OpenApiValidator {
}
}
const fn = tmpModules[modulePath][oId];
if (!tmpModules[modulePath][oId]) {
throw Error(`Could not resolve 'x-eov-operation-handler' function in module '${modulePath}' for with id '${oId}'. Make sure a function exists for id '${oId}'.`)
}
app[method.toLowerCase()](expressRoute, fn);
}
}
Expand Down

0 comments on commit c3aaa62

Please sign in to comment.