13#include <KLocalizedString>
19const char *Error::typeToString(Type t)
29 CASE(SlashWithoutAsterisk);
30 CASE(IllegalCharacter);
31 CASE(UnexpectedCharacter);
32 CASE(NoLeadingDigits);
33 CASE(NonCWSAfterTextColon);
35 CASE(NumberOutOfRange);
38 CASE(UnfinishedBracketComment);
39 CASE(PrematureEndOfMultiLine);
40 CASE(PrematureEndOfQuotedString);
41 CASE(PrematureEndOfStringList);
42 CASE(PrematureEndOfTestList);
43 CASE(PrematureEndOfBlock);
44 CASE(MissingWhitespace);
45 CASE(MissingSemicolonOrBlock);
47 CASE(ExpectedBlockOrSemicolon);
48 CASE(ExpectedCommand);
49 CASE(ConsecutiveCommasInStringList);
50 CASE(ConsecutiveCommasInTestList);
51 CASE(MissingCommaInTestList);
52 CASE(MissingCommaInStringList);
53 CASE(NonStringInStringList);
54 CASE(NonCommandInCommandList);
55 CASE(NonTestInTestList);
57 CASE(RequireNotFirst);
58 CASE(RequireMissingForCommand);
59 CASE(RequireMissingForTest);
60 CASE(RequireMissingForComparator);
61 CASE(UnsupportedCommand);
62 CASE(UnsupportedTest);
63 CASE(UnsupportedComparator);
64 CASE(TestNestingTooDeep);
65 CASE(BlockNestingTooDeep);
66 CASE(InvalidArgument);
67 CASE(ConflictingArguments);
68 CASE(ArgumentsRepeated);
69 CASE(CommandOrderingConstraintViolation);
71 CASE(IncompatibleActionsRequested);
72 CASE(MailLoopDetected);
91 err =
i18n(
"Parse error: Carriage Return (CR) without Line Feed (LF)");
93 case SlashWithoutAsterisk:
95 "Parse error: Unquoted Slash ('/') without Asterisk ('*'). "
98 case IllegalCharacter:
99 err =
i18n(
"Parse error: Illegal Character");
101 case UnexpectedCharacter:
102 err =
i18n(
"Parse error: Unexpected Character, probably a missing space?");
104 case NoLeadingDigits:
105 err =
i18n(
"Parse error: Tag Name has leading Digits");
107 case NonCWSAfterTextColon:
109 "Parse error: Only whitespace and #comments may "
110 "follow \"text:\" on the same line");
112 case NumberOutOfRange:
113 err =
i18n(
"Parse error: Number out of Range (must be smaller than %1)", UINT_MAX);
116 err =
i18n(
"Parse error: Invalid UTF-8 sequence");
118 case PrematureEndOfMultiLine:
119 err =
i18n(
"Parse error: Premature end of Multiline String (did you forget the '.'?)");
121 case PrematureEndOfQuotedString:
122 err =
i18n(
"Parse error: Premature end of Quoted String (missing closing '\"')");
124 case PrematureEndOfStringList:
125 err =
i18n(
"Parse error: Premature end of String List (missing closing ']')");
127 case PrematureEndOfTestList:
128 err =
i18n(
"Parse error: Premature end of Test List (missing closing ')')");
130 case PrematureEndOfBlock:
131 err =
i18n(
"Parse error: Premature end of Block (missing closing '}')");
133 case MissingWhitespace:
134 err =
i18n(
"Parse error: Missing Whitespace");
136 case MissingSemicolonOrBlock:
137 err =
i18n(
"Parse error: Missing ';' or Block");
139 case ExpectedBlockOrSemicolon:
140 err =
i18n(
"Parse error: Expected ';' or '{', got something else");
142 case ExpectedCommand:
143 err =
i18n(
"Parse error: Expected Command, got something else");
145 case ConsecutiveCommasInStringList:
146 err =
i18n(
"Parse error: Trailing, Leading or Duplicate Commas in String List");
148 case ConsecutiveCommasInTestList:
149 err =
i18n(
"Parse error: Trailing, Leading or Duplicate Commas in Test List");
151 case MissingCommaInStringList:
152 err =
i18n(
"Parse error: Missing ',' between Strings in String List");
154 case MissingCommaInTestList:
155 err =
i18n(
"Parse error: Missing ',' between Tests in Test List");
157 case NonCommandInCommandList:
158 err =
i18n(
"Parse error: Expected Command, got something else");
160 case NonStringInStringList:
161 err =
i18n(
"Parse error: Only Strings allowed in String Lists");
163 case NonTestInTestList:
164 err =
i18n(
"Parse error: Only Tests allowed in Test Lists");
168 case RequireNotFirst:
169 err =
i18n(
"\"require\" must be first command");
171 case RequireMissingForCommand:
172 err =
i18n(
"\"require\" missing for command \"%1\"", mStringOne);
174 case RequireMissingForTest:
175 err =
i18n(
"\"require\" missing for test \"%1\"", mStringOne);
177 case RequireMissingForComparator:
178 err =
i18n(
"\"require\" missing for comparator \"%1\"", mStringOne);
180 case UnsupportedCommand:
181 err =
i18n(
"Command \"%1\" not supported", mStringOne);
183 case UnsupportedTest:
184 err =
i18n(
"Test \"%1\" not supported", mStringOne);
186 case UnsupportedComparator:
187 err =
i18n(
"Comparator \"%1\" not supported", mStringOne);
189 case TestNestingTooDeep:
190 err =
i18n(
"Site Policy Limit Violation: Test nesting too deep (max. %1)", mStringOne.
toUInt());
192 case BlockNestingTooDeep:
193 err =
i18n(
"Site Policy Limit Violation: Block nesting too deep (max. %1)", mStringOne.
toUInt());
195 case InvalidArgument:
196 err =
i18n(
"Invalid Argument \"%1\" to \"%2\"", mStringOne, mStringTwo);
198 case ConflictingArguments:
199 err =
i18n(
"Conflicting Arguments: \"%1\" and \"%2\"", mStringOne, mStringTwo);
201 case ArgumentsRepeated:
202 err =
i18n(
"Argument \"%1\" Repeated", mStringOne);
204 case CommandOrderingConstraintViolation:
205 err =
i18n(
"Command \"%1\" violates command ordering constraints", mStringOne);
209 case IncompatibleActionsRequested:
210 err =
i18n(
"Incompatible Actions \"%1\" and \"%2\" requested", mStringOne, mStringTwo);
212 case MailLoopDetected:
213 err =
i18n(
"Mail Loop detected");
216 err =
i18n(
"Site Policy Limit Violation: Too many Actions requested (max. %1)", mStringOne.
toUInt());
219 err =
i18n(
"Unknown error");
QString i18n(const char *text, const TYPE &arg...)
uint toUInt(bool *ok, int base) const const