-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
On the client, is there any way I could access the error message/object that was returned by validator() method?
primus.id.validator(function validate(spark, fn) {
if (spark.mirage === 'old') return fn(undefined, 'new');
if (spark.mirage === 'new') return fn(undefined, 'old');
fn(new Error('The id is neither new or old')); //<--- how do I access this error object on client?
});I am trying to make sure accounts are in a specific state but I need to know where/how validator function failed? I could have done it in authentication middleware but I can still not detect the error message there (or correct me if I am wrong).
I was thinking if we could have an event thrown on client something like 'mirage error' with this error object then that would solve this problem.
Metadata
Metadata
Assignees
Labels
No labels