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

**URL:** <https://community.auth0.com/t/if-a-rule-in-auth0-calls-the-callback-with-error-will-the-next-continue/42546>\
**Category:** Get Help\
**Tags:** rules, auth0\
**Created:** [May 7, 2020, 7:59am UTC](https://community.auth0.com/t/if-a-rule-in-auth0-calls-the-callback-with-error-will-the-next-continue/42546 "2020-05-07T07:59:06Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![alexab](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/alexab/32/13403_2.png) [@alexab](https://community.auth0.com/u/alexab)\
**Post date:** [May 7, 2020, 7:59am UTC](https://community.auth0.com/t/if-a-rule-in-auth0-calls-the-callback-with-error-will-the-next-continue/42546/1 "2020-05-07T07:59:06Z")

</div>

The title says it all 😌

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

Thanks for the help.

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [May 7, 2020, 8:44am UTC](https://community.auth0.com/t/if-a-rule-in-auth0-calls-the-callback-with-error-will-the-next-continue/42546/3 "2020-05-07T08:44:31Z")

</div>

Hey there @alexab!

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

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [May 7, 2020, 11:32am UTC](https://community.auth0.com/t/if-a-rule-in-auth0-calls-the-callback-with-error-will-the-next-continue/42546/4 "2020-05-07T11:32:24Z")

</div>

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

> **[Auth0 Rules](https://auth0.com/docs/customize/rules)**
>
> Learn about Rules and how you can use them to customize and extend Auth0's capabilities.

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.

---

<div class="post-metadata">

**Author:** ![alexab](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/alexab/32/13403_2.png) [@alexab](https://community.auth0.com/u/alexab)\
**Post date:** [May 8, 2020, 6:41am UTC](https://community.auth0.com/t/if-a-rule-in-auth0-calls-the-callback-with-error-will-the-next-continue/42546/5 "2020-05-08T06:41:45Z")

</div>

Ok - fair suggestion 🔧 I will get back with my findings when I have the time 🤓

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [May 11, 2020, 9:42pm UTC](https://community.auth0.com/t/if-a-rule-in-auth0-calls-the-callback-with-error-will-the-next-continue/42546/6 "2020-05-11T21:42:10Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![alexab](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/alexab/32/13403_2.png) [@alexab](https://community.auth0.com/u/alexab)\
**Post date:** [May 12, 2020, 5:39am UTC](https://community.auth0.com/t/if-a-rule-in-auth0-calls-the-callback-with-error-will-the-next-continue/42546/7 "2020-05-12T05:39:31Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [May 12, 2020, 8:15pm UTC](https://community.auth0.com/t/if-a-rule-in-auth0-calls-the-callback-with-error-will-the-next-continue/42546/8 "2020-05-12T20:15:17Z")

</div>

It is mentioned in the [rules best practices](https://auth0.com/docs/best-practices/rules#callback-function) 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](https://auth0.com/docs/rules/references/legacy#deny-access-based-on-a-condition) 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.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [May 27, 2020, 8:15pm UTC](https://community.auth0.com/t/if-a-rule-in-auth0-calls-the-callback-with-error-will-the-next-continue/42546/9 "2020-05-27T20:15:18Z")

</div>

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