* @summary Call this method to raise a compilation or linting error for the * file. * @param {Object} options * @param {String} options.message The error message to display. * @param {String} [options.sourcePath] The path to display in the error message. * @param {Integer} options.lin
(options)
| 497 | * @memberof InputFile |
| 498 | */ |
| 499 | error(options) { |
| 500 | var self = this; |
| 501 | var path = self.getPathInPackage(); |
| 502 | var packageName = self.getPackageName(); |
| 503 | if (packageName) { |
| 504 | path = "packages/" + packageName + "/" + path; |
| 505 | } |
| 506 | |
| 507 | self._reportError(options.message || ("error building " + path), { |
| 508 | file: options.sourcePath || path, |
| 509 | line: options.line ? options.line : undefined, |
| 510 | column: options.column ? options.column : undefined, |
| 511 | func: options.func ? options.func : undefined |
| 512 | }); |
| 513 | } |
| 514 | |
| 515 | // Default implementation. May be overridden by subclasses. |
| 516 | _reportError(message, info) { |