steel-frame 7.0.3 → 7.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -14,10 +14,18 @@ export var Errors;
|
|
|
14
14
|
Errors[Errors["ParserError"] = 5] = "ParserError";
|
|
15
15
|
Errors[Errors["RulesOfVasille"] = 6] = "RulesOfVasille";
|
|
16
16
|
})(Errors || (Errors = {}));
|
|
17
|
+
const friendlyErrors = {
|
|
18
|
+
[Errors.IncorrectArguments]: "Incorrect arguments",
|
|
19
|
+
[Errors.IncompatibleContext]: "Incompatible context",
|
|
20
|
+
[Errors.TokenNotSupported]: "Token is not supported",
|
|
21
|
+
[Errors.Dilemma]: "Dilemma",
|
|
22
|
+
[Errors.ParserError]: "Parser error",
|
|
23
|
+
[Errors.RulesOfVasille]: "Тhe framework rule was broken",
|
|
24
|
+
};
|
|
17
25
|
export function err(e, node, content, internal, ret) {
|
|
18
26
|
const limit = Error.stackTraceLimit;
|
|
19
27
|
Error.stackTraceLimit = 0;
|
|
20
|
-
const error = node.buildCodeFrameError(
|
|
28
|
+
const error = node.buildCodeFrameError(`${friendlyErrors[e]}: ${content}`, Error);
|
|
21
29
|
Error.stackTraceLimit = limit;
|
|
22
30
|
internal.reportError(`${Errors[e]}: ${content}`, node.node, error);
|
|
23
31
|
return ret;
|