ref_error.ts
1 import {resolveUrl, normalizeId, getFullPath} from "./resolve" 2 3 export default class MissingRefError extends Error { 4 readonly missingRef: string 5 readonly missingSchema: string 6 7 constructor(baseId: string, ref: string, msg?: string) { 8 super(msg || `can't resolve reference ${ref} from id ${baseId}`) 9 this.missingRef = resolveUrl(baseId, ref) 10 this.missingSchema = normalizeId(getFullPath(this.missingRef)) 11 } 12 }