@prisma/client APIs
- PrismaClient
- Prisma
- User
- Tag
- Post
- Subscription
- course_category_enum
- notification_sender_enum
- student
- course_coursestate_enum
- PriceType
- SubscriptionStatus
- pupil
- EnumSubscriptionStatus
- Price
- PriceInterval
- Block
- BlockTransaction
- DepositHead
- Transaction
- Deposit
- EnumEntityAction
- EventType
- PrismaPromise
- Version
- CasbinRule
- ModelName
- PrismaAction
- PrismaClientKnownRequestError
- PrismaClientValidationError
- OrderItemCreateWithoutOrderInput
- Enumerable
- AddressCreateManyWithoutCustomerInput
- Customer
- Todo
- Infraction
- Media
- Role
- PickType
- Generator
- UseCase
- CastType
- Episode
- Download
- Frame
- Room
- Video
- View
- ghSites
- notionSites
- EnumSubscriptionPlan
- InfractionType
- BodyguardTier
- Profile
- InventoryItem
- ENTITY
- RELATED_ENTITY
- EnumDataType
- Account
- GitRepository
- Workspace
- UserRole
- Build
- MediaType
- EnumEntityPermissionType
Other Related APIs
@prisma/client#PrismaClientKnownRequestError TypeScript Examples
The following examples show how to use
@prisma/client#PrismaClientKnownRequestError.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: index.ts From next-crud with MIT License | 6 votes |
handleError(err: Error) {
console.error(err.message)
if (
err instanceof PrismaClientKnownRequestError ||
err instanceof PrismaClientValidationError
) {
throw new HttpError(
400,
'invalid request, check your server logs for more info'
)
} else {
throw new HttpError(
500,
'an unknown error occured, check your server logs for more info'
)
}
}