Skip to content

Commit cc757de

Browse files
authored
Merge pull request #230 from JaredCE/fix-missing-model-from-http-error
pass through the model to the error handler
2 parents 39d9eb4 + c39c4cc commit cc757de

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "serverless-openapi-documenter",
3-
"version": "0.0.104",
3+
"version": "0.0.105",
44
"description": "Generate OpenAPI v3 documentation and Postman Collections from your Serverless Config",
55
"main": "index.js",
66
"keywords": [
@@ -55,7 +55,7 @@
5555
"uuid": "^9.0.1"
5656
},
5757
"engines": {
58-
"node": ">=14"
58+
"node": ">=16"
5959
},
6060
"devDependencies": {
6161
"chai": "^4.3.10",

src/schemaHandler.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@ class SchemaHandler {
6868
).catch((err) => {
6969
if (err.errors) {
7070
for (const error of err?.errors) {
71-
this.__HTTPError(error);
71+
this.__HTTPError(error, model);
7272
}
7373
} else {
74-
this.__HTTPError(err);
74+
this.__HTTPError(err, model);
7575
}
7676
return modelSchema;
7777
});
@@ -228,7 +228,7 @@ class SchemaHandler {
228228
}
229229
}
230230

231-
__HTTPError(error) {
231+
__HTTPError(error, model) {
232232
if (error.message.includes("HTTP ERROR")) {
233233
// throw err;
234234
throw new Error(

0 commit comments

Comments
 (0)