mapbox-gl
Version:
A WebGL interactive maps library
16 lines (12 loc) • 439 B
JavaScript
// @flow
export default class ValidationError extends Error {
identifier: ?string;
line: ?number;
constructor(key: string | null, value?: any, message?: string, identifier?: string) {
super([key, message].filter(a => a).join(': '));
if (identifier) this.identifier = identifier;
if (value !== null && value !== undefined && value.__line__) {
this.line = value.__line__;
}
}
}