P
Prisma6mo ago
Mickaël

Redirected false error 400

I don't understand why I cannot create a document
No description
No description
No description
Solution:
After some troubleshooting the problem was caused by a type error as prisma was being passed a string instead of an object. After parsing the json string there was a different type error introduced by using connect instead of idEnvelope.
Jump to solution
22 Replies
Mickaël
MickaëlOP6mo ago
No description
Lord Zd
Lord Zd6mo ago
Could you send the full error you a receiving to help narrow down where the problem is occurring, I suspect your a missing a required field in your query.
Mickaël
MickaëlOP6mo ago
No description
Mickaël
MickaëlOP6mo ago
the error is here, when I fetch it return internal server error
No description
No description
Mickaël
MickaëlOP6mo ago
but when I create a user it work perfect, idem for the envelope and it the same, but for the document it don't want to work
Lord Zd
Lord Zd6mo ago
In the api endpoint your fetching you have a try catch statement which returns status 500 are you able to confirm if that code is being executed?
Mickaël
MickaëlOP6mo ago
no because just before I add a console.log and I don't see it I remove the ty catch
Lord Zd
Lord Zd6mo ago
Okay this would suggest that the error is unrelated to your prisma query and could be caused by something like middlewares etc
Mickaël
MickaëlOP6mo ago
it's the line 117 who make this message ok so what can i do ?
Lord Zd
Lord Zd6mo ago
I would console.log res and see what the output is and then trace the http request to see what code is being executed before it gets to your prisma query
Mickaël
MickaëlOP6mo ago
No description
Lord Zd
Lord Zd6mo ago
By trace the http request I mean go from the entrypoint of your application e.g index.js/server.js and follow the path the request would make and add some temporary console.logs in any code that is executed before hand to narrow down where the Internal server error is being sent from
Mickaël
MickaëlOP6mo ago
I not sure how to do that. In fact I'm a beginner I don't think I understand but is there any doc to follow ?
Lord Zd
Lord Zd6mo ago
Erm I will have a look see if i can find any resource for you
Mickaël
MickaëlOP6mo ago
or maybe It's because of the need of the envelope to create the document
Lord Zd
Lord Zd6mo ago
If it was the try catch would of triggered giving you a verbose prisma error
Mickaël
MickaëlOP6mo ago
I see thanks you very much
Lord Zd
Lord Zd6mo ago
I can jump on a call and walk you through what I mean if youd like
Mickaël
MickaëlOP6mo ago
ow of course I ok with that meet ?
Lord Zd
Lord Zd6mo ago
Sent you a friend request
Mickaël
MickaëlOP6mo ago
I think I accept
Solution
Lord Zd
Lord Zd6mo ago
After some troubleshooting the problem was caused by a type error as prisma was being passed a string instead of an object. After parsing the json string there was a different type error introduced by using connect instead of idEnvelope.
Want results from more Discord servers?
Add your server