How to handle custom errors returned from rules in lock?

I am following this link (Customize Lock Error Messages) to handle custom errors returned from rules in lock. But every time my rule throw any error instead of getting dictionary error defined in lock it will throw error to my app.
Here is the code:

function (user, context, callback) {
if (user.email === “some@email.com”) {
return callback(new ValidationError(‘custom_error’,‘Access to this application has been temporarily revoked’));
}
callback(null, user, context);
}

And here is the dictionary code in lock (hosted page)
var languageDictionary = {
title: config.dict.signin.title,
error: {
login: {
“lock.unauthorized”: “Custom message about a failure of permissions”,
“custom_error”: “Custom error message”
}
}
};

Now I am expecting to get the error “Custom error message” but I am getting this “'Access to this application has been temporarily revoked”. What am i doing wrong?
PS: It’s working fine for custom errors in custom database script

A post was merged into an existing topic: Internationalization in Auth0 rules