-
-
Notifications
You must be signed in to change notification settings - Fork 127
Closed
Labels
Milestone
Description
Description and expected behavior
When using @default together with auth(), i.e. @default(auth().id) and no user context is set when making a create query a normal error is thrown instead of an PrismaClientKnownRequestError like it would be if the access policies are violated.
Further more this error seems to be thrown before those access policies are checked at all.
The line where is error is thrown:
| throw new Error(`Evaluating default value of field \`${fieldInfo.name}\` requires a user context`); |
Because a normal error is thrown instead of a specific one error handling is made difficult because every error needs to be caught instead of filtering for, for example, an PrismaClientKnownRequestError.
Environment (please complete the following information):
- ZenStack version: 2.3.2
- Prisma version: 5.15.0
- Database type: Postgresql
ymc9