Hey <@498057949541826571> can i show the error mes...
# support-questions-legacy
s
Hey @rp_st can i show the error message on the frontend itself for some given input values from the pre,postApiHook or handleEvent hook(don't want to make a login call for some specific inputs)
r
Hey. Yes you can.
You can simply override the sign in function on the frontend
s
I want to show the Supertokens style error box, like this
getAuthorisationURLFromBackend(input) { console.log('getAuthorisationURLFromBackend'); console.log(input); if(some_condition) { return new Promise((res, rej) => { rej(new Error('Some custom error message')); }); } return originalImplementation.getAuthorisationURLFromBackend(input); },
this doesn't seem to work?
@rp_st
r
You need to throw a supertokens general error instead of a regular error. Checkout our frontend SDK code to find this error please.
s
@rp_st i am using the ThirdPartyPasswordless recipe, can you link me to the frontend SDK for it? @rp_st
r
when u throw the error that you showed above, what happens?
s
"I get the Something went wrong. Please try again"
instead i want the error message on the UI to be "something custom goes here"
@rp_st
r
i see. Yea. So throwing a general error will solve this problem. You can do that by:
Copy code
let err = new Error("custom message")
err.isSuperTokensGeneralError = true;
reject(err)