Hello! πŸ‘‹ My NestJS is always sending 200 as Http...
# support-questions-legacy
i
Hello! πŸ‘‹ My NestJS is always sending 200 as Http status code, even when failing (when invoking Supertokens endpoints). Is this the expected outcome?
r
Hey @iruizmar can you give me an example of when you are expecting it to return a non 200 and it’s returning a 200?
i
Hey @rp_st! For example, on the OTP /consume method, if the OTP is invalid. Or if the deviceId/preAuthSessionId are wrong.
I would expect some 400 there.
r
So we differentiate between expected and unexpected errors. A 400 would happen if the request body is of a different structure than what the api expects. Vs the request body is of the right structure, but semantically something is wrong (for example the OTP is invalid)
This is done so that developers are forced to handle states like invalid OTP explicitly
i
Ok! That sounds indeed opinionated. Makes sense. Thanks πŸ™‚
r
Yup
10 Views