You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# ATTENTION: In the event of an exception while creating an error, we encounter a chicken-and-egg problem regarding error definitions.
25
+
# Therefore, errors created by this library must be defined "statically" within this file.
26
+
# Details should then be used to create a low-level error. The information should also be used to create/update the error-codes.json
27
+
# as part of the release preparation. This is only necessary for this library, as it is the root, other libraries should use
28
+
# the `ec` command-line tool to update and create their project specifc error-codes.json file.
29
+
INVALID_ERROR_CODE=_ExaStaticError(
30
+
identifier="E-ERP-1",
31
+
message="Invalid error code {{code}}.",
32
+
messagePlaceholders=[
33
+
{
34
+
"placeholder": "code",
35
+
"description": "Error code which was causing the error.",
36
+
}
37
+
],
38
+
description=None,
39
+
mitigations=["Ensure you follow the standard error code format."],
40
+
sourceFile=Path(__file__).name,
41
+
)
42
+
43
+
UNKNOWN_EXCEPTION_OCCURED=_ExaStaticError(
44
+
identifier="E-ERP-2",
45
+
message="Unknown error/exception occurred.",
46
+
messagePlaceholders=[
47
+
{
48
+
"placeholder": "traceback",
49
+
"description": "Exception traceback which lead to the generation of this error.",
50
+
}
51
+
],
52
+
description="An unexpected error occurred during the creation of the error",
53
+
mitigations=[
54
+
cleandoc(
55
+
"""
56
+
A good starting point would be to investigate the cause of the attached exception.
57
+
58
+
Trackback:
59
+
{{traceback}}
60
+
"""
61
+
)
62
+
],
63
+
sourceFile=Path(__file__).name,
64
+
)
65
+
66
+
INVALID_ERROR_CODE_DEFINITION=_ExaStaticError(
67
+
identifier="E-ERP-3",
68
+
message="Invalid error code definition: {{error_element}} only can contain constant values, but is of type: {{defined_type}}. In file {{file}} line {{line}}",
69
+
messagePlaceholders=[
70
+
{
71
+
"error_element": "The element within the error definition which caused the error.",
72
+
"defined_type": "The actual Python type of the error definition.",
73
+
"file": "The file in which the error occurred.",
74
+
"line": "The line where the error occurred.",
75
+
}
76
+
],
77
+
description="An unexpected error occurred during the creation of the error catalog, when parsing the project for EXA error codes.",
78
+
mitigations=[
79
+
cleandoc(
80
+
"""
81
+
Check the definition of ExaError. Possible errors:
82
+
1. Usage of none-constant expression in error code, message
83
+
2. Mitigations are not a list, but another container
0 commit comments