If a rule in Auth0 calls the callback with Error, will the next continue?

The title says it all :relieved:

If the first rule calls the callback with an error, will the next rule execute?

Thanks for the help.

Hey there @alexab!

Good question. Need to check! Will get back to you shortly!

1 Like

There’s no info about that in our docs about rules:

Alex what I would suggest is to create a blank rule below the rule that calls the callback with an error that simply prints something and check trying this out.

1 Like

Ok - fair suggestion :wrench: I will get back with my findings when I have the time :nerd_face:

Hi again @alexab,

Coming from your other topic.

No, the subsequent rules will not run if the previous returns the callback with an error like callback(new UnauthorizedError('Invalid IP address'));

Hope this helps!

1 Like

Hi Dan - this helps a lot :raised_hands: Something that might be missing from the official documentation?

1 Like

It is mentioned in the rules best practices docs:

The status parameter should be passed as either null , an instance of an Error object, or an instance of an UnauthorizedError object. Specifying null will permit the continuation of pipeline processing, while any of the other values will terminate the pipeline; an UnauthorizedError signals denial of access and allows information to be returned to the originator of the authentication operation regarding the reason why access is denied. Passing any other value for any of these parameters will have unpredictable results and may lead to an exception or error condition.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.