maplibre-gl
Version:
BSD licensed community fork of mapbox-gl, a WebGL interactive maps library
19 lines (15 loc) • 541 B
text/typescript
// Note: Do not inherit from Error. It breaks when transpiling to ES5.
export default class ValidationError {
message: string;
identifier: string;
line: number;
constructor(key: string, value: any & {
__line__: number;
}, message: string, identifier?: string | null) {
this.message = (key ? `${key}: ` : '') + message;
if (identifier) this.identifier = identifier;
if (value !== null && value !== undefined && value.__line__) {
this.line = value.__line__;
}
}
}