Files
coopgo/node_modules/@mapbox/mapbox-gl-style-spec/error/parsing_error.js
sgauthier 6e64e138e2
All checks were successful
Publish To Prod / deploy_and_publish (push) Successful in 35s
planning
2024-10-14 09:15:30 +02:00

17 lines
395 B
JavaScript

// @flow
// Note: Do not inherit from Error. It breaks when transpiling to ES5.
export default class ParsingError {
message: string;
error: Error;
line: number;
constructor(error: Error) {
this.error = error;
this.message = error.message;
const match = error.message.match(/line (\d+)/);
this.line = match ? parseInt(match[1], 10) : 0;
}
}