defaultMessageResolver function
Returns the default error message for the given Msg error code.
Implementation
String defaultMessageResolver(Msg msg) => switch (msg) {
Msg.operandMissing => "expected a search term after `{0}`",
Msg.columnUnknown => "unknown field `{0}` (valid fields: {1})",
Msg.columnTermMissing => "expected a search term after `:`",
Msg.proximityInvalid =>
"NEAR distance must be a whole number, 0 or greater; got `{0}`",
Msg.proximityMissing => "expected a NEAR distance after the comma",
Msg.nearParenOpenMissing => "expected `(` after `NEAR`",
Msg.nearTermMissing => "expected a search term after `NEAR(`",
Msg.nearTermsTwoExpected =>
"expected a second search term in the NEAR clause",
Msg.parenCloseMissing => "expected a closing `)`",
Msg.parenOpenExprMissing => "expected a search term after `(`",
Msg.phraseIncomplete => "expected a search term after `+`",
Msg.quotedUnterminated => "quoted phrase is missing its closing `\"`",
Msg.columnExpected => "after `-`, expected a field followed by `:`",
Msg.compoundIncomplete => "expected a word immediately after `-`",
Msg.misplacedSymbol => "got symbol `{0}`",
Msg.misplacedKeyword => "got keyword `{0}`",
Msg.misplacedCompound => "got text `{0}`",
Msg.misplacedSpace =>
"got {0, select, U+0020 {space} other {whitespace character `{0}`}}",
Msg.misplacedCharacter => "got character `{0}`",
Msg.queryEmpty => "expected a search term",
Msg.endExpected => "expected a search term or the end of the query",
Msg.expectedButGot => "{0}; {1}",
};