From 47b7a18916721e8802a6dab8d33f9f015a9e3d7a Mon Sep 17 00:00:00 2001 From: Konstantin Vyatkin Date: Wed, 26 Jan 2022 19:15:21 +0100 Subject: [PATCH] Fix `thow` With `throw: true` we are getting error: ```sh TypeError: self.root.emitError is not a function at ValidateLayer.addErrorList (/Users/tino-afflu/Repos/cloud-data-sources-tf/node_modules/jsonschemaparse/lib/schema.js:1124:42) at ValidateLayer.startString (/Users/tino-afflu/Repos/cloud-data-sources-tf/node_modules/jsonschemaparse/lib/schema.js:1209:8) at /Users/tino-afflu/Repos/cloud-data-sources-tf/node_modules/jsonschemaparse/lib/parse.js:1236:46 at /Users/tino-afflu/Repos/cloud-data-sources-tf/node_modules/jsonschemaparse/lib/parse.js:323:3 at Array.forEach () at StreamParser.validateInstance (/Users/tino-afflu/Repos/cloud-data-sources-tf/node_modules/jsonschemaparse/lib/parse.js:322:23) at StreamParser.startString (/Users/tino-afflu/Repos/cloud-data-sources-tf/node_modules/jsonschemaparse/lib/parse.js:1236:7) at StreamParser.parseBlock (/Users/tino-afflu/Repos/cloud-data-sources-tf/node_modules/jsonschemaparse/lib/parse.js:436:10) at StreamParser.Object..StreamParser._transform.StreamParser._write (/Users/tino-afflu/Repos/cloud-data-sources-tf/node_modules/jsonschemaparse/lib/parse.js:329:8) at writeOrBuffer (node:internal/streams/writable:389:12) ``` --- lib/schema.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/schema.js b/lib/schema.js index eb7f2ae..2715c0c 100644 --- a/lib/schema.js +++ b/lib/schema.js @@ -1051,6 +1051,7 @@ function ValidateLayer(schema, root, argv){ validator.errors = root.errors; validator.throw = root.throw; validator.annotations = root.annotations; + validator.emitError = root.emitError; }else{ validator.errors = []; validator.throw = null;