How to return meaningful error after pre-user registration hook fail?

Within an pre-user registration hook I perform checks that can result in user registration denial. In this case the hook throws an error:

const error = new Error("message');
error.statusCode = 400;
return cb(error);

The testrunners returns the correct result, however, the error given back as response to the request to https://my-account.auth0.com/dbconnections/signup is still a quite meaningless 500.
Is it possible to influence the message and status code there too?

See also

At this time there’s no support to propagate the exact error message and code all the way from the hook to the top-level API, in this case /dbconnections/signup. This is a gap that already has been identified and discussed, but for now I can’t provide a definitive timeline for it’s availability.

Any news on that topic ?

Markus

I’m afraid not, it’s still listed in the backlog so there’s no additional information I can share besides what is already in the answer.

Just wanted to let anyone finding this thread in the future know that it is now possible to propagate an error message from the pre-registration-hook to the user (but only with new universal login): https://auth0.com/docs/hooks/extensibility-points/pre-user-registration#sample-script-customize-the-error-message-and-language-for-user-messages

Thanks for the update Thomas!