Closed Flexla54 closed 1 year ago
Wrong responses almost everywhere "where: {" is used. There are too much cases where this happens, why I do not list every case. => The list above is only partially correct!
Why is this happening? All of these endpoints were tested for spcifically this behavior... makes no sense at all
All of these endpoints actually have error handling code, it seems more like a bigger bug of the error handling subsystem, so I am assigning myself.
You can continue to work on your code normally, I think I can resolve this without any updated to the specific errors (eg. NotFoundError)
- [ ] GET api/participants/"nonexistingPid"
- 404: Endpoint not implemented
This is right, because this endpoint is in fact not implemented
- [x] GET api/media/"nonexistingPid"
- 404: Endpoint not implemented
Fixed
@Flexla54
All the others were not reproducible on my local setup, please look if this was just a problem with the configuration and merge the PR if everything works
Thanks for your effort so far. However i was able to reproduce those issues with another PC. It happens in dev mode. I was not able to reproduce this problem in production mode. I try to figure out what goes wrong here...
Funny, not happening to me with dev mode
Well after some research and discussion with @stephan418 figured out that this problem occurs due to inconsitant errohandling. When a non-existing pid gets handed over first thing prisma throws is a "PrismaClientUnknownRequestError". Sometimes it is handled in the controller itself (eg. events) [wrong approach] mostly it's handled by the common.ts errhandler [right solution].
Before any tasks are defined i want do discuss wether the errorhandler in the controller are still useful or not?
If the handling of the PrismaClientUnknownRequestError
is the only problem, we could simply remove all of those handlers.. this should no take more than a few minutes
How the server responds (falsely) at the following requests:
The right response should be from the NotFoundError The requested "Resource-Name" with PID "nonexistingPID" could not be found!