GuidesError HandlingError Messages

Prisma

Arkos intercepts Prisma client errors and maps them to clean HTTP responses automatically. You never need to catch Prisma errors manually — throw them and the global error handler does the rest.

Connection and Infrastructure Errors

These fire when Arkos cannot reach or initialize the database:

Prisma CodeMessageStatusCode
P1000Authentication failed against the database server. Please check your credentials.401Unknown
P1001The database server is not reachable. Verify your connection string or ensure the server is online.503Unknown
P1002Connection to the database timed out. Please check server performance or network connectivity.504Unknown
P1003The specified database does not exist on the server.404Unknown

Data Errors

These fire during query and mutation operations:

Prisma CodeMessageStatusCode
P2000The value for the field "{field}" is too large. Please provide a smaller value.400Unknown
P2001No record found for the given query. Ensure the query parameters are correct.404Unknown
P2002Duplicate value detected for the unique field(s): {field}. Please use a different value.409{Model}{Field}UniqueConstraint
P2003Foreign key constraint violation. Ensure that the referenced record exists.400Unknown
P2004A database constraint "{constraint}" failed. Please review your input data.400Unknown
P2025Cause from Prisma meta, or Operation could not be completed as some required record was not found400 or 404InlineRecordNotFound or RecordNotFound

Migration Errors

These fire during schema migration operations:

Prisma CodeMessageStatusCode
P3000Failed to create the database schema. Verify the schema definition and try again.500Unknown
P3001The migration "{name}" has already been applied to the database.409Unknown
P3002The migration script "{name}" failed. Review the script and resolve any issues.500Unknown
P3003Version mismatch: The database schema and migration versions are inconsistent.400Unknown

Validation Errors

Error TypeMessageStatus
PrismaClientValidationErrorLast line of Prisma's validation message400
PrismaClientInitializationErrorService temporarily unavailable503

For the full list of Prisma error codes and what triggers them, see the Prisma error reference.