Skip to content

Incorrect error response when a policy rejection occurs (in REST API flavor context) #449

@Azzerty23

Description

@Azzerty23

Description and expected behavior
I expect to receive a 403 error response indicating a lack of permission.

Screenshots
Capture d’écran 2023-06-02 à 15 16 59

Environment (please complete the following information):

  • ZenStack version: [e.g., 1.0.0-alpha.122]
  • Prisma version: [e.g., 4.14.0]
  • Database type: [e.g. Sqlite]

Additional context
Response detail: Cannot read properties of undefined (reading 'PrismaClientKnownRequestError')\nTypeError: Cannot read properties of undefined (reading 'PrismaClientKnownRequestError')\n at prismaClientKnownRequestError (/Users/augustin/Documents/Dev/Test/zenstack-rest-turbo/apps/express-api/dist/index.js:15890:50)\n at PolicyUtil.deniedByPolicy (/Users/augustin/Documents/Dev/Test/zenstack-rest-turbo/apps/express-api/dist/index.js:24086:58)\n at PolicyProxyHandler. (/Users/augustin/Documents/Dev/Test/zenstack-rest-turbo/apps/express-api/dist/index.js:24460:30)\n at Generator.next ()\n at fulfilled (/Users/augustin/Documents/Dev/Test/zenstack-rest-turbo/apps/express-api/dist/index.js:24200:28)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions