Try Catch function not working in bubble

Options
macgyver
macgyver Member

I just found a perfect use for the Try Catch function in my application. Which works fine when I run and debug in xano. However when I run it in my application in bubble I am getting an error.

This is the error

This is when an image is added in the Run and Debug

and this is without an image

This is how I have it set up

If I add an image in bubble it works fine. I only get the error when I do not edit the image.This is an edit record page in my application. I have not tried to use the Try Catch for my enter record yet. I just knew I had an issue with the edit and was hoping this new function was the answer I was looking for.

Comments

  • Michael Udinski
    Michael Udinski Administrator

    ADMIN

    Options

    Hi @macgyver can you investigate the API request history when this error happens? That might help give us some more clues as to what's going on

  • macgyver
    Options

    OK here is what is showing in the history. I have no idea what to look for

  • macgyver
    Options

    I thought that when an error is triggered then it should move to the catch.

  • Michael Udinski
    Michael Udinski Administrator

    ADMIN

    Options

    Explain the output to see what the error message is

  • macgyver
    macgyver Member
    edited September 2023
    Options
  • Michael Udinski
    Michael Udinski Administrator

    ADMIN

    Options

    It looks like the error is how you have something mapped in your Add or Edit Record. Expanding payload and param should tell you what field you need to fix

  • macgyver
    Options

    @Michael Udinski

    Ok so I think I found the problem. This function is for an edit, it is editing an existing database entry. If the user decided not to edit the image this is the error (first image). If you look you can see that the https: is entered twice. The reason for this is because in bubble in order to create the image file you have to add https: before the dynamic data (second image).

    If the user changes the image during editing the image file is created and their is no error (third image).

    I did find a work around in bubble (images four and five), however it would be nice to use the Try Catch function correctly but im not sure how to eliminate if possible the double https: I figured because it did throw an error that it would work.

    I'm still learning all this and it seems that most of the time there is a work around but it does take some time to figure them out.