.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / table / node_modules / ajv / lib / compile / ref_error.ts
diff --git a/.config/coc/extensions/node_modules/coc-prettier/node_modules/table/node_modules/ajv/lib/compile/ref_error.ts b/.config/coc/extensions/node_modules/coc-prettier/node_modules/table/node_modules/ajv/lib/compile/ref_error.ts
new file mode 100644 (file)
index 0000000..22b70b9
--- /dev/null
@@ -0,0 +1,12 @@
+import {resolveUrl, normalizeId, getFullPath} from "./resolve"
+
+export default class MissingRefError extends Error {
+  readonly missingRef: string
+  readonly missingSchema: string
+
+  constructor(baseId: string, ref: string, msg?: string) {
+    super(msg || `can't resolve reference ${ref} from id ${baseId}`)
+    this.missingRef = resolveUrl(baseId, ref)
+    this.missingSchema = normalizeId(getFullPath(this.missingRef))
+  }
+}