# Error Handling in API Workflows

**URL:** <https://forum.bubble.io/t/error-handling-in-api-workflows/13218>\
**Category:** APIs\
**Created:** [May 8, 2017, 1:29am UTC](https://forum.bubble.io/t/error-handling-in-api-workflows/13218 "2017-05-08T01:29:00Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![mishav](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/mishav/32/6420_2.png) [@mishav](https://forum.bubble.io/u/mishav)\
**Post date:** [October 18, 2018, 8:47am UTC](https://forum.bubble.io/t/error-handling-in-api-workflows/13218/21 "2018-10-18T08:47:56Z")

</div>

> [@keith](#):
>
> for cases where it’s essential for an error to “bubble” up to the user level, you basically have to shim your calls to external APIs in order to convert error objects into something Bubble can deal with

Can go part of the way there with the server-side scripts, a small prototype on this page: [https://toolbox-example.bubbleapps.io/version-test/serverscript](https://toolbox-example.bubbleapps.io/version-test/serverscript)

---

<div class="post-metadata">

**Author:** ![gevestobs](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/gevestobs/32/19091_2.png) [@gevestobs](https://forum.bubble.io/u/gevestobs)\
**Post date:** [November 7, 2018, 8:53pm UTC](https://forum.bubble.io/t/error-handling-in-api-workflows/13218/22 "2018-11-07T20:53:19Z")

</div>

While this hasn’t been updated, my solution has been to use external endpoints (can be AWS lambda or whatever you’re comfortable with, I’m using Python/Flask). These endpoints make the error prone calls, do error handling, and pass data back to bubble.

Though setting the endpoints up might be slightly annoying at first. I like the flexibility it provides with handling requests and dealing with things like nested fields. It also has the added benefit of letting you use SDKs and external libraries, which tends to make processes less stressful.

---

<div class="post-metadata">

**Author:** ![scott3](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/scott3/32/18530_2.png) [@scott3](https://forum.bubble.io/u/scott3)\
**Post date:** [March 4, 2019, 4:08pm UTC](https://forum.bubble.io/t/error-handling-in-api-workflows/13218/23 "2019-03-04T16:08:27Z")

</div>

Bumping this thread - and @gevestobs same… I’ve been constructing Express/Node servers to handle endpoints. Agreed with your point - it does allow for flexibility, although 1) its tricky to use these combined with bubble workflows (ie., if there’s an error, don’t create this item!)… and 2) it’s beyond the ability of your average bubble no code user and against the ‘no code’ ethos of Bubble. Overall, frustrating.

---

<div class="post-metadata">

**Author:** ![jules.marcilhacy](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/jules.marcilhacy/32/19863_2.png) [@jules.marcilhacy](https://forum.bubble.io/u/jules.marcilhacy)\
**Post date:** [July 17, 2019, 5:52pm UTC](https://forum.bubble.io/t/error-handling-in-api-workflows/13218/24 "2019-07-17T17:52:26Z")

</div>

I am also looking for a solution to this …

---

<div class="post-metadata">

**Author:** ![miguel](https://avatars.discourse-cdn.com/v4/letter/m/439d5e/32.png) [@miguel](https://forum.bubble.io/u/miguel)\
**Post date:** [August 5, 2019, 12:02pm UTC](https://forum.bubble.io/t/error-handling-in-api-workflows/13218/25 "2019-08-05T12:02:55Z")

</div>

In this case, you could use a workflow of type ‘An unhandled error occurs’. This WF will catch the error caused by a user signing in with an email address that already exists.

Although Bubble should merge accounts automatically (if we want to). This has been requested here: [Email account linked with social media](http://forum.bubble.io/t/email-account-linked-with-social-media/51113)

Regards.

---

<div class="post-metadata">

**Author:** ![nicolas\_dap](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/nicolas_dap/32/26345_2.png) [@nicolas\_dap](https://forum.bubble.io/u/nicolas_dap)\
**Post date:** [August 5, 2019, 1:30pm UTC](https://forum.bubble.io/t/error-handling-in-api-workflows/13218/26 "2019-08-05T13:30:21Z")

</div>

> [@miguel](#):
>
> you could use a workflow of type ‘An unhandled error occurs’

this feature is only available in page’s workflows, not in API Workflows

---

<div class="post-metadata">

**Author:** ![miguel](https://avatars.discourse-cdn.com/v4/letter/m/439d5e/32.png) [@miguel](https://forum.bubble.io/u/miguel)\
**Post date:** [August 6, 2019, 2:30pm UTC](https://forum.bubble.io/t/error-handling-in-api-workflows/13218/27 "2019-08-06T14:30:35Z")

</div>

That’s right. He can use it at a page level to manage authentication issues.

---

<div class="post-metadata">

**Author:** ![serg.sargsyan](https://avatars.discourse-cdn.com/v4/letter/s/ba8739/32.png) [@serg.sargsyan](https://forum.bubble.io/u/serg.sargsyan)\
**Post date:** [September 7, 2019, 10:30pm UTC](https://forum.bubble.io/t/error-handling-in-api-workflows/13218/28 "2019-09-07T22:30:37Z")

</div>

hey @Bubble team please prioritize this. This makes API connectors useless. It is ok for API-s to return errors in some cases and they need to be handled properly.

---

<div class="post-metadata">

**Author:** ![serg.sargsyan](https://avatars.discourse-cdn.com/v4/letter/s/ba8739/32.png) [@serg.sargsyan](https://forum.bubble.io/u/serg.sargsyan)\
**Post date:** [September 8, 2019, 12:00pm UTC](https://forum.bubble.io/t/error-handling-in-api-workflows/13218/29 "2019-09-08T12:00:15Z")

</div>

Bug, Bug, Bug alert. Seems it is a bug. When API connector call is called when page is being loaded “An unhandled error occurs” event is not triggered. But when I call the same API connector call after a button click then “An unhandled error occurs” event is triggered. @Bubble can you have a look on this?

---

<div class="post-metadata">

**Author:** ![JohnMark](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/johnmark/32/42431_2.png) [@JohnMark](https://forum.bubble.io/u/JohnMark)\
**Post date:** [September 8, 2019, 12:02pm UTC](https://forum.bubble.io/t/error-handling-in-api-workflows/13218/30 "2019-09-08T12:02:52Z")

</div>

Hi @serg.sargsyan,

I suggest you to send a bug report with a specific example (with a video if possible) so  
that Bubble can validate on their side.

* * *

 ![08%20AM](https://us1.discourse-cdn.com/bubble/original/3X/0/1/014ba343c648dc661197fadae8d6dc87a2d60190.png)

---

<div class="post-metadata">

**Author:** ![brad.h](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/brad.h/32/61687_2.png) [@brad.h](https://forum.bubble.io/u/brad.h)\
**Post date:** [November 22, 2019, 4:58pm UTC](https://forum.bubble.io/t/error-handling-in-api-workflows/13218/31 "2019-11-22T16:58:25Z")

</div>

Hi All,

Did anyone find a fix yet? I need to hide external API Errors from the user.

I built a calculator similar to the [BMI Calculator video](https://vimeo.com/162728948) @bubble posted, by using the [math.js API](https://api.mathjs.org). I set up multiple inputs that calculates a result on the fly. But I also added a submit button to deliver the inputs to my database. The problem is, the math.js API reads an error when the inputs are blank. I don’t allow “submit” to be pressed without the inputs filled. However, the external API still sends the error based on the originally empty inputs. I don’t want the user to see this error. The workflow still works and all the data is delivered and calculated correctly - but the error is sent to the user based on the initial data (which I need blank to start).

 ![DB1FA7A7-1A5D-4F81-9983-EC8C326AB318_1_201_a](https://us1.discourse-cdn.com/bubble/original/3X/6/6/66e44031a80c4cd01c77f5bae2ab10d5033d9668.jpeg)

If bubble would be willing to continue with the BMI calculator video, I would suggest:

- Add a submit button to the BMI calcualtor
- Recreate the external Api error from math.js when inputs are empty
- Then show us how to hide the error message from users.

Maybe @romanmg would be interested in the next short video topic (her videos are amazing btw)?

---

<div class="post-metadata">

**Author:** ![anon90100206](https://avatars.discourse-cdn.com/v4/letter/a/d26b3c/32.png) [@anon90100206](https://forum.bubble.io/u/anon90100206)\
**Post date:** [January 6, 2020, 5:55pm UTC](https://forum.bubble.io/t/error-handling-in-api-workflows/13218/32 "2020-01-06T17:55:15Z")

</div>

I ran into this problem too because I need to access an URL that is sent in the header of an error response. No news here I suppose?

---

<div class="post-metadata">

**Author:** ![shaun](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/shaun/32/61669_2.png) [@shaun](https://forum.bubble.io/u/shaun)\
**Post date:** [February 24, 2020, 11:35am UTC](https://forum.bubble.io/t/error-handling-in-api-workflows/13218/33 "2020-02-24T11:35:55Z")

</div>

Oh wow! I’ve just ran into this error whilst testing a postcode looking on my site and despite the fact that I have created conditions to handle all of the errors it wont work because bubble shows their own error message which shows the user what API service that I’m using and doesn’t even display a professional message.

> **[Screen Recording 2020-02-24 at 11.41.36.15 AM.gif](https://share.getcloudapp.com/DOu8GK8R)**
>
> Shared with CloudApp

This is actually ridiculous! Surely there must be a solution… I cannot launch the app like this! People mistype postcodes all the time

---

<div class="post-metadata">

**Author:** ![shaun](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/shaun/32/61669_2.png) [@shaun](https://forum.bubble.io/u/shaun)\
**Post date:** [March 2, 2020, 10:53pm UTC](https://forum.bubble.io/t/error-handling-in-api-workflows/13218/34 "2020-03-02T22:53:03Z")

</div>

Cracked it thanks to @romanmg at coachingnocodeapps… I’m a member of her VIP group and she had a tutorial on bubbles ability to handle workflow errors.

I actually tried this and it didn’t work but in one of her tutorials she pointed out the “An element has an error running a workflow” option and when I linked this up to the button is worked!

My postcode feature now works perfectly without the ugly default notifications popping up… I have no idea why the catch all version didn’t work but I’m very happy that it’s now working as it should be!!!

🙂

---

<div class="post-metadata">

**Author:** ![nicolas\_dap](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/nicolas_dap/32/26345_2.png) [@nicolas\_dap](https://forum.bubble.io/u/nicolas_dap)\
**Post date:** [March 3, 2020, 4:55pm UTC](https://forum.bubble.io/t/error-handling-in-api-workflows/13218/35 "2020-03-03T16:55:31Z")

</div>

Good for you.  
I thought it was about Backend Workflows (formerly “API Workflows”)

---

<div class="post-metadata">

**Author:** ![anttiv](https://avatars.discourse-cdn.com/v4/letter/a/d78d45/32.png) [@anttiv](https://forum.bubble.io/u/anttiv)\
**Post date:** [June 15, 2020, 6:51am UTC](https://forum.bubble.io/t/error-handling-in-api-workflows/13218/36 "2020-06-15T06:51:52Z")

</div>

This helped me. When error occurs, i just created another workflow it.

[![](https://img.youtube.com/vi/AITGodtyVyw/hqdefault.jpg "How to Use Bubble's Error Handling Workflow Events") ](https://www.youtube.com/watch?v=AITGodtyVyw)

---

<div class="post-metadata">

**Author:** ![nicolas\_dap](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/nicolas_dap/32/26345_2.png) [@nicolas\_dap](https://forum.bubble.io/u/nicolas_dap)\
**Post date:** [June 15, 2020, 4:13pm UTC](https://forum.bubble.io/t/error-handling-in-api-workflows/13218/37 "2020-06-15T16:13:13Z")

</div>

“An element has an error running a workflow” works on a page, while it is opened.  
But Backend workflows are different.

---

<div class="post-metadata">

**Author:** ![christo1](https://avatars.discourse-cdn.com/v4/letter/c/9f8e36/32.png) [@christo1](https://forum.bubble.io/u/christo1)\
**Post date:** [June 17, 2020, 7:45am UTC](https://forum.bubble.io/t/error-handling-in-api-workflows/13218/38 "2020-06-17T07:45:59Z")

</div>

Same issue with Backend Workflows here. If the Workflow would simply go to the next step regardless of an error like x not found, then that’s part of the way there.

---

<div class="post-metadata">

**Author:** ![christo1](https://avatars.discourse-cdn.com/v4/letter/c/9f8e36/32.png) [@christo1](https://forum.bubble.io/u/christo1)\
**Post date:** [June 17, 2020, 9:09pm UTC](https://forum.bubble.io/t/error-handling-in-api-workflows/13218/39 "2020-06-17T21:09:28Z")

</div>

I have found a workaround for my issue in Backend workflows, where a whole workflow would stop if I was looking up a value in an API and that value was not found. Bubble would see the error and nothing else (other checks) would take place. I simply moved the one, which is likley to error to its own workflow, which I then call from the triggered workflow. Even if it errors, the original continues unhindered. Not sure if it will help…

---

<div class="post-metadata">

**Author:** ![nicolas.bousson](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/nicolas.bousson/32/23521_2.png) [@nicolas.bousson](https://forum.bubble.io/u/nicolas.bousson)\
**Post date:** [September 8, 2020, 10:36am UTC](https://forum.bubble.io/t/error-handling-in-api-workflows/13218/40 "2020-09-08T10:36:32Z")

</div>

Dear Bubble support,

We noticed a problem/bug in the error treatment in case of an user already-signedup (with for example email, facebook or google signins), who signs up again using a different methods.

We already interacted with you about the fact that in such a case, an error is raised “Error’s code = USED\_EMAIL”. This makes the signup treatments much more complicated, but is better for security reasons you told us. Fine. However, we noticed the following problem:

- case#1: a) If the initial signup was facebook or google, and the second attempt is by email, the WorflowError’message contains “via Facebook” or “via Google”, which is very convenient for telling the user. GREAT. b) If this is the opposite: 1st signup=email, and 2nd signup attempt=facebook or google, then the error message is “blank[email@address]”. OK…

- case #2: If the initial signup was facebook or google, and the second attempt is another social network, for example: 1st signup=facebook, 2nd signup attempt=google, or 1stsignup=google and 2nd signup attempt=facebook, then the Error message raised in the 2nd signup attempt doesn’t contain “via Facebook” or “via Google”. Even worse, it is of the same format as in case #1b… which makes it impossible to disantangle the siutation…

This is very ANNOYING, because we would like to simply tell the user “It seems you already signed up with Facebook, please try to reconnect with social network for security reasons” -\> and show them directly a Facebook login/signin button.

Could you please fix the error message in such a case (#2) please ?

Thanks a lot for your help @eve

Best regards,

Nicolas

[Previous page](https://forum.bubble.io/t/error-handling-in-api-workflows/13218.md?page=1)

[Next page](https://forum.bubble.io/t/error-handling-in-api-workflows/13218.md?page=3)
