1import { formatPath } from "../Formatter.ts"
2
3/** @internal */
4export function errorWithPath(message: string, path: ReadonlyArray<PropertyKey>) {
5 if (path.length > 0) {
6 message += `\n at ${formatPath(path)}`
7 }
8 return new Error(message)
9}