Skip to content

Breaking change: Error classes are exported as types #4365

@Sytten

Description

@Sytten

Bug description

I used to be able to do:

import { PrismaClientKnownRequestError } from '@prisma/client';

if (!(err instanceof PrismaClientKnownRequestError)) {
    ...
  }

But now the classes are exported as types so we can't use them in instanceof.

Expected behavior

They should be exported as values.

Environment & setup

  • Prisma version: 2.12.0

Metadata

Metadata

Assignees

Labels

bug/2-confirmedBug has been reproduced and confirmed.kind/bugA reported bug.tech/typescriptIssue for tech TypeScript.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions