PrismaClientInitializationError class

Prisma Client throws a PrismaClientInitializationError exception if something goes wrong when the query engine is started and the connection to the database is created. This happens either:

  • When prisma.$connect() is called OR
  • When the first query is executed

Errors that can occur include:

  • The provided credentials for the database are invalid
  • There is no database server running under the provided hostname and port
  • The port that the query engine HTTP server wants to bind to is already taken
  • A missing or inaccessible environment variable
  • The query engine binary for the current platform could not be found (generator block)
Implemented types
Annotations
  • @JsonSerializable(createFactory: true, createToJson: false)

Constructors

PrismaClientInitializationError(String message, {required String clientVersion, String? errorCode})
const
PrismaClientInitializationError.fromJson(Map<String, dynamic> json)
factory

Properties

clientVersion String
Version of Prisma Client (for example, 2.19.0)
final
errorCode String?
A Prisma-specific error code.
final
hashCode int
The hash code for this object.
no setterinherited
message String
Error message associated with error code.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited