Urara-Blog/node_modules/.pnpm-store/v3/files/7e/fa286f2b2abcd49a8d4962099325a3fd9427634153528e69b055c856348b1bd9325b38e573b389d08f00e7e09664573f02d47421b94bdbde99072189609f26
2022-08-14 01:14:53 +08:00

13 lines
513 B
Text

import {resolveUrl, normalizeId, getFullPath} from "./resolve"
import type {UriResolver} from "../types"
export default class MissingRefError extends Error {
readonly missingRef: string
readonly missingSchema: string
constructor(resolver: UriResolver, baseId: string, ref: string, msg?: string) {
super(msg || `can't resolve reference ${ref} from id ${baseId}`)
this.missingRef = resolveUrl(resolver, baseId, ref)
this.missingSchema = normalizeId(getFullPath(resolver, this.missingRef))
}
}