Skip to content

Commit

Permalink
chore: update validation message (#800)
Browse files Browse the repository at this point in the history
  • Loading branch information
ymc9 authored Nov 1, 2023
1 parent 742f606 commit d9e5b23
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ export default class ExpressionValidator implements AstValidator<Expression> {
if (!expr.$resolvedType) {
if (isAuthInvocation(expr)) {
// check was done at link time
accept('error', 'auth() cannot be resolved because no "User" model is defined', { node: expr });
accept(
'error',
'auth() cannot be resolved because no model marked wth "@@auth()" or named "User" is found',
{ node: expr }
);
} else if (isCollectionPredicate(expr)) {
accept('error', 'collection predicate can only be used on an array of model type', { node: expr });
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,7 @@ describe('Attribute tests', () => {
@@allow('all', auth() != null)
}
`)
).toContain(`auth() cannot be resolved because no "User" model is defined`);
).toContain(`auth() cannot be resolved because no model marked wth "@@auth()" or named "User" is found`);

await loadModel(`
${prelude}
Expand Down

0 comments on commit d9e5b23

Please sign in to comment.