source: frontend/node_modules/fork-ts-checker-webpack-plugin/lib/issue/IssueWebpackError.js

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 1.1 KB
Line 
1"use strict";
2var __importDefault = (this && this.__importDefault) || function (mod) {
3 return (mod && mod.__esModule) ? mod : { "default": mod };
4};
5Object.defineProperty(exports, "__esModule", { value: true });
6const path_1 = require("path");
7const IssueLocation_1 = require("./IssueLocation");
8const forwardSlash_1 = __importDefault(require("../utils/path/forwardSlash"));
9class IssueWebpackError extends Error {
10 constructor(message, issue) {
11 super(message);
12 this.issue = issue;
13 this.hideStack = true;
14 // to display issue location using `loc` property, webpack requires `error.module` which
15 // should be a NormalModule instance.
16 // to avoid such a dependency, we do a workaround - error.file will contain formatted location instead
17 if (issue.file) {
18 this.file = forwardSlash_1.default(path_1.relative(process.cwd(), issue.file));
19 if (issue.location) {
20 this.file += `:${IssueLocation_1.formatIssueLocation(issue.location)}`;
21 }
22 }
23 Error.captureStackTrace(this, this.constructor);
24 }
25}
26exports.IssueWebpackError = IssueWebpackError;
Note: See TracBrowser for help on using the repository browser.