You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, when bundling the server to a main.js file for easier/optimized deployment the error stacks get pretty useless. In my case a minified error log might look like this:
Error in POST /domain: P2002
Invalid `prisma.domain.create()` invocation:
Unique constraint failed on the fields: (`name`).
Thrown at PrismaClientKnownRequestError:
Invalid `prisma.domain.create()` invocation:
Unique constraint failed on the fields: (`name`)
at new PrismaClientKnownRequestError (/out/main.js:28:1417)
at handleRequestError (/out/main.js:128:6900)
at handleAndLogRequestError (/out/main.js:128:6228)
at <anonymous> (/out/main.js:128:5935)
at processTicksAndRejections (:12:39)
{"name":"PrismaClientKnownRequestError","code":"P2002","clientVersion":"5.15.0","meta":{"modelName":"Domain","target":["name"]},"originalLine":6033,"originalColumn":12}
While this is the log statement in my on error handler:
Because of bundling and minification my error log is not very helpful since every error will occur in that line and file, it's all in main.js
Did you consider re-mapping that information internally? E.g. something similar to this might do the job:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi, when bundling the server to a main.js file for easier/optimized deployment the error stacks get pretty useless. In my case a minified error log might look like this:
While this is the log statement in my on error handler:
Because of bundling and minification my error log is not very helpful since every error will occur in that line and file, it's all in main.js
Did you consider re-mapping that information internally? E.g. something similar to this might do the job:
Which then should output more useful info!
Beta Was this translation helpful? Give feedback.
All reactions