Skip to content

Commit

Permalink
rename err msgs
Browse files Browse the repository at this point in the history
  • Loading branch information
lesleydreyer committed Nov 6, 2023
1 parent 6a25d30 commit 58ad964
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export class QueryAccess<T extends ts.AnyObject = ts.AnyObject> {
if (startsWithWildcard(value, node.type)) {
const errMessage = node.type === p.NodeType.Wildcard
? "Queries starting with wildcards in the form 'fieldname:*value' or 'fieldname:?value' are restricted"
: "Queries starting with regular expressions in the form 'fieldname:/.*value/' or 'fieldname:/.?value/' are restricted";
: "Regular expression queries starting with wildcards in the form 'fieldname:/.*value/' or 'fieldname:/.?value/' are restricted";

throw new ts.TSError(errMessage, {
statusCode: 403,
Expand Down
2 changes: 1 addition & 1 deletion packages/xlucene-translator/test/query-access-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ describe('QueryAccess', () => {
it('should throw an error', () => {
expect(() => queryAccess.restrict(query)).toThrowWithMessage(
TSError,
"Queries starting with regular expressions in the form 'fieldname:/.*value/' or 'fieldname:/.?value/' are restricted"
"Regular expression queries starting with wildcards in the form 'fieldname:/.*value/' or 'fieldname:/.?value/' are restricted"
);
});
});
Expand Down

0 comments on commit 58ad964

Please sign in to comment.