UNPKG

@redocly/openapi-core

Version:

See https://github.com/Redocly/redocly-cli

14 lines 581 B
const jsYamlErrorLineColRegexp = /\((\d+):(\d+)\)$/; export class YamlParseError extends Error { constructor(originalError, source) { super(originalError.message.split('\n')[0]); this.originalError = originalError; this.source = source; // Set the prototype explicitly. Object.setPrototypeOf(this, YamlParseError.prototype); const [, line, col] = this.message.match(jsYamlErrorLineColRegexp) || []; this.line = parseInt(line, 10); this.col = parseInt(col, 10); } } //# sourceMappingURL=yaml-parse-error.js.map