# iOS: Display custom error message from action access.deny

**URL:** <https://community.auth0.com/t/ios-display-custom-error-message-from-action-access-deny/68008>\
**Category:** Get Help\
**Tags:** auth0swift, ios\
**Created:** [August 16, 2021, 2:55pm UTC](https://community.auth0.com/t/ios-display-custom-error-message-from-action-access-deny/68008 "2021-08-16T14:55:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marius](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/marius/32/12206_2.png) [@Marius](https://community.auth0.com/u/Marius)\
**Post date:** [August 16, 2021, 2:55pm UTC](https://community.auth0.com/t/ios-display-custom-error-message-from-action-access-deny/68008/1 "2021-08-16T14:55:14Z")

</div>

Greetings!

We are using the auth0/Auth0.swift SDK Version 1.35.0. When returning an error message via a **Login-Action,** we get a generic error message, instead of the one returned in the action.

 ![Unbenannt](https://global.discourse-cdn.com/auth0/original/3X/0/d/0d1266cd39cb46018c43622d2b8c3c5c3a2836c4.jpeg)

We previously had a **Rule** that checks if a user is verified. If not, we returned  
`return callback(new UnauthorizedError('our custom error message'));`  
This worked just fine. We got ‘our custom error message’.

Now we wanted to switch to **Actions**. Inside the action we return the error like this  
` api.access.deny('our custom error message');`

But instead of our error message, the login shows the generic error, as seen in the screenshot.

What can we do, to display the error passed by api.access.deny() to the user?  
In the logs everything looks fine, the error description is ‘our custom error message’. We also have a web app and an Android app were the correct error message is shown and everything works fine.

(First we had the same issue with android, see [Android: Access custom error message from action access.deny](https://community.auth0.com/t/android-access-custom-error-message-from-action-access-deny/67756) but an SDK update did not fix it for iOS 😀)

Thanks  
Marius

---

<div class="post-metadata">

**Author:** ![Marius](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/marius/32/12206_2.png) [@Marius](https://community.auth0.com/u/Marius)\
**Post date:** [September 1, 2021, 2:12pm UTC](https://community.auth0.com/t/ios-display-custom-error-message-from-action-access-deny/68008/2 "2021-09-01T14:12:32Z")

</div>

Issue doestn occur anymore… don’t ask me why. Sorry!

---

<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:** [September 1, 2021, 2:45pm UTC](https://community.auth0.com/t/ios-display-custom-error-message-from-action-access-deny/68008/3 "2021-09-01T14:45:13Z")

</div>

Perfect! Glad to hear that!

---

<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:** [September 16, 2021, 2:45pm UTC](https://community.auth0.com/t/ios-display-custom-error-message-from-action-access-deny/68008/4 "2021-09-16T14:45:21Z")

</div>

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