If I want to return custom error from Rules I simply do
callback(new UnauthorizedError('Custom error message here')) but how do I do the same thing with Hooks?
callback('error message'); callback(new Error('error message'));
Those didn’t worked and
UnauthorizedError is undefined in Hooks. Whatever I do, on front-end side I always get
WE'RE SORRY, SOMETHING WENT WRONG WHEN ATTEMPTING TO SIGN UP. and when I inspect result of requested I see that there is no difference, each time
Why do I want to return error from Hooks? I run extra validation for sign-up there.