summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/ref.jst
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/ref.jst')
-rw-r--r--deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/ref.jst21
1 files changed, 10 insertions, 11 deletions
diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/ref.jst b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/ref.jst
index e8cdc4435a..4a08896860 100644
--- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/ref.jst
+++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/ref.jst
@@ -25,21 +25,16 @@
{{??}}
{{ var $refVal = it.resolveRef(it.baseId, $schema, it.isRoot); }}
{{? $refVal === undefined }}
- {{ var $message = 'can\'t resolve reference ' + $schema + ' from id ' + it.baseId; }}
+ {{ var $message = it.MissingRefError.message(it.baseId, $schema); }}
{{? it.opts.missingRefs == 'fail' }}
- {{ console.log($message); }}
+ {{ console.error($message); }}
{{# def.error:'$ref' }}
{{? $breakOnError }} if (false) { {{?}}
{{?? it.opts.missingRefs == 'ignore' }}
- {{ console.log($message); }}
+ {{ console.warn($message); }}
{{? $breakOnError }} if (true) { {{?}}
{{??}}
- {{
- var $error = new Error($message);
- $error.missingRef = it.resolve.url(it.baseId, $schema);
- $error.missingSchema = it.resolve.normalizeId(it.resolve.fullPath($error.missingRef));
- throw $error;
- }}
+ {{ throw new it.MissingRefError(it.baseId, $schema, $message); }}
{{?}}
{{?? $refVal.inline }}
{{# def.setupNextLevel }}
@@ -68,12 +63,16 @@
{{? $async }}
{{ if (!it.async) throw new Error('async schema referenced by sync schema'); }}
- try { {{? $breakOnError }}var {{=$valid}} ={{?}} {{=it.yieldAwait}} {{=__callValidate}}; }
- catch (e) {
+ {{? $breakOnError }} var {{=$valid}}; {{?}}
+ try {
+ {{=it.yieldAwait}} {{=__callValidate}};
+ {{? $breakOnError }} {{=$valid}} = true; {{?}}
+ } catch (e) {
if (!(e instanceof ValidationError)) throw e;
if (vErrors === null) vErrors = e.errors;
else vErrors = vErrors.concat(e.errors);
errors = vErrors.length;
+ {{? $breakOnError }} {{=$valid}} = false; {{?}}
}
{{? $breakOnError }} if ({{=$valid}}) { {{?}}
{{??}}