When my backend returns an error 500, my entire fr...
# support-questions-legacy
l
When my backend returns an error 500, my entire frontend goes down because Supertoken ask me to wrap the entire app in SuperTokensWrapper which doesn't see to handle errors properly... How can I avoid that?
r
hey @lfhenriquez this happens cause you need to add an error boundary in your app
l
I have one!
r
outside the supertokenswrapper?
perhaps @porcellus can help here
l
I could add one outside supertokenswrapper, but even if it catches the error, my entire app which is inside the wrapper will be down...
p
yep, it should be outside that as sometimes that'll get errors.
hi 🙂
but yeah, a 500 response to the refresh api could cause something like this.
l
So what should I do ?
(by the way thanks for your quick answer!)
I know I should do anything to prevent an error 500 on this endpoint but unfortunately due to some constraint it does happen during a few seconds during my deploy...
p
I'd say add a handler outside the wrapper for this. I'm not sure if there is a better way.
Btw, does this only happen if your refresh endpoint throws?
l
I'd say add a handler outside the wrapper for this. I'm not sure if there is a better way. ----> I've tried to do it but doesn't work 😢
Btw, does this only happen if your refresh endpoint throws? ---> I'm sorry, what do you mean?
p
Do you only get this error screen if the refresh endpoint returns a 500 error?
or does this happen any time you get a 500?
also, does the error boundary work if you don't wrap it with
SuperTokensWrapper
? It'd be very odd if that'd cause it to somehow "dodge" your error boundary.
I meant if you don't have the SuperTokensWrapper inside it.
l
To my knowledge it only happens if the refresh token return an error 500 (not the other endpoints)
It does seem to "dodge" my error boundary...
(by the way I found an easy way to reproduce this error by blocking the request in chrome)
p
hmm. that's strange. I'll check it out in a bit and get back to you.
btw, do you happen to have a repo where I could test this?
l
Unfortunately it is on my company app so I can't share it 😢
p
This doesn't seem to be happening in our example. Even without an error boundary if I block the request I only get redirected to auth.
l
Ok... That's weird because the request is made by SuperTokens and I don't modify it...
How could I dig into it?
p
Well, it may be just that I missed something during the reproduction
One way could be to try and check if it happens in our example
r
can we get on a call @lfhenriquez to help fix this?
l
Yes @rp_st it would be awesome! Here is my calendly to find a time slot: https://calendly.com/leonard-capsule/
r
awesome! have scheduled it. thanks