Comments (4)
https://github.com/milindgoel15/prisma-errors
Create a minimal repo with local sqlite, prisma and nextjs to show how errors could be better thrown. Wrote a basic error explanation in readme file
from prisma.
This is not a stacktrace, this is an extended pretty-printend message.
If you want to disable this formatting, you can supply { errorFormat: "minimal" }
option to the client constructor. See our documentation here.
from prisma.
It seems setting errorformat to minimal has no effect on what I want/suggested. It still throws out the whole stack trace or extended pretty message. What I noticed is that the pretty printed message is just a stripped stack trace.
I think minimal should throw the last line of the pretty printed message like below:
'Argument `stock`: Invalid value provided. Expected Int or IntFieldUpdateOperationsInput, provided String.'
This is my prisma handler code:
import { PrismaClient } from "@prisma/client";
const prismaClientSingleton = () => {
return new PrismaClient({
errorFormat: "minimal",
});
};
declare global {
var prisma: undefined | ReturnType<typeof prismaClientSingleton>;
}
const prisma = global.prisma ?? prismaClientSingleton();
export default prisma;
if (process.env.NODE_ENV !== "production") global.prisma = prisma;
Just to note, does adding the options require any change to above code? Server restart needed? Do cache needs to be cleared?
My current workaround is to split everything in the message and return the last string.
from prisma.
Can you please provide a full example of the output or return you are getting with the error? RIght now you are just describing it, but we have not actually seen what the problem is. Optimally you also provide a minimal example for us how to reproduce it, so we can play around with it ourselves. Thank you.
from prisma.
Related Issues (20)
- Sort by property of `Json` field HOT 1
- Error: Could not parse schema engine response: SyntaxError: Unexpected token '/', "/data/data"... is not valid JSON HOT 2
- npx prisma generate gives the download error
- ::INET column type not supported when creating HOT 4
- @prisma/extension-pulse is not exported from package HOT 6
- Disambiguating relations incorrectly auto formatting HOT 7
- Many-to-many relationship not through linking table
- Raw query returning a bigint for an int field HOT 1
- error Command "up" not found. HOT 1
- Repeated alter migrations in Postgres for `String[] @default([]) @db.VarChar(64)`
- In "prisma" mode, executing prisma db pull results in the loss of generated fields.
- Dynamic load relations
- Error Thrown When Sorting Field Is Not Selected HOT 3
- ConnectorError(ConnectorError { user_facing_error: None, kind: QueryError(PostgresError { code: "42P05", message: "prepared statement \"s0\" already exists", severity: "ERROR", detail: None, column: None, hint: None }), transient: false })]
- How to Perform Group By with Date Extraction in Prisma
- Unable to require libquery_engine-debian-openssl-3.0.x.so.node HOT 2
- Hello @bso-oo 👋 HOT 2
- Run Prisma on docker use elysia/Bun js HOT 1
- Inconsistent column data: Malformed ObjectID: provided hex string representation must be exactly 12 bytes, instead got HOT 2
- Support for manually managing prepared statements HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from prisma.