Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dedicated error for "Referential integrity violation" #1

Open
e965 opened this issue Dec 18, 2024 · 0 comments
Open

Add dedicated error for "Referential integrity violation" #1

e965 opened this issue Dec 18, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@e965
Copy link

e965 commented Dec 18, 2024

At the moment, you need to write this check code every time:

if (error instanceof Error && error.message === "Referential integrity violation") {
  ...
}

I would like to have a special instance (extended Error) so I can write more shortly:

import { RlsError } from 'prisma-rls'

if (error instanceof RlsError) {
  ...
}

RlsError it's an example name

@s1owjke s1owjke changed the title Feature request - Special instance for "Referential integrity violation" error Add dedicated error for "Referential integrity violation" Dec 18, 2024
@s1owjke s1owjke added the enhancement New feature or request label Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants