<@498057949541826571> When using SuperTokens and ...
# support-questions-legacy
h
@rp_st When using SuperTokens and overriding specific functions like signup or signIn, I need the capability to return custom JSON responses to the frontend UI. Specifically, I aim to relay HTTP Exceptions with unique status codes (either 4XX or 5XX) based on the nature of the error. In my current approach, I utilize SuperTokens'
GeneralErrorResponse
class:
Copy code
try:
    result = await original_emailpassword_sign_in_post(form_fields, tenant_id, api_options, user_context)
except Exception as e:
    logger.error(e)
    return GeneralErrorResponse(f"Internal Server Error:- {str(e)}")
` However, this results in a response like:
Copy code
{
  "status": "GENERAL_ERROR",
  "message": "Internal Server Error:- User hi101903252@gmail.com is suspended"
}
The challenge is that this response always carries a status code of 200. I am looking for a way to customize this response's status code based on the specific error encountered, rather than always receiving a 200 status code.
3 Views