Last change
on this file since fa375fe was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
968 bytes
|
Line | |
---|
1 | "use strict";
|
---|
2 |
|
---|
3 | Object.defineProperty(exports, "__esModule", {
|
---|
4 | value: true
|
---|
5 | });
|
---|
6 | exports.default = void 0;
|
---|
7 |
|
---|
8 | class CssSyntaxError extends Error {
|
---|
9 | constructor(error) {
|
---|
10 | super(error);
|
---|
11 | const {
|
---|
12 | reason,
|
---|
13 | line,
|
---|
14 | column,
|
---|
15 | file
|
---|
16 | } = error;
|
---|
17 | this.name = "CssSyntaxError"; // Based on https://github.com/postcss/postcss/blob/master/lib/css-syntax-error.es6#L132
|
---|
18 | // We don't need `plugin` and `file` properties.
|
---|
19 |
|
---|
20 | this.message = `${this.name}\n\n`;
|
---|
21 |
|
---|
22 | if (typeof line !== "undefined") {
|
---|
23 | this.message += `(${line}:${column}) `;
|
---|
24 | }
|
---|
25 |
|
---|
26 | this.message += file ? `${file} ` : "<css input> ";
|
---|
27 | this.message += `${reason}`;
|
---|
28 | const code = error.showSourceCode();
|
---|
29 |
|
---|
30 | if (code) {
|
---|
31 | this.message += `\n\n${code}\n`;
|
---|
32 | } // We don't need stack https://github.com/postcss/postcss/blob/master/docs/guidelines/runner.md#31-dont-show-js-stack-for-csssyntaxerror
|
---|
33 |
|
---|
34 |
|
---|
35 | this.stack = false;
|
---|
36 | }
|
---|
37 |
|
---|
38 | }
|
---|
39 |
|
---|
40 | exports.default = CssSyntaxError; |
---|
Note:
See
TracBrowser
for help on using the repository browser.