When a external API call get erros inside a loop.

Options
geraldoNeto
geraldoNeto Unconfirmed, Member
edited September 2023 in ? Working with APIs

Whem I'm creating a record I get some data from a external api. I do it in a list with a loop function, but when a call gets not found, all the functions stops. My questions is: There's a filter that I can use to ignore this call in case it dosent get 200 response and carry on the functions just giving 0 for the result from api and don't stop the function?

Tagged:

Answers

  • Liz Anaya
    Liz Anaya Member, Administrator

    ADMIN

    Options

    Hi @geraldoNeto! 👋

    Check out the try/ catch function. Normally, when an error occurs in the function stack, execution is halted entirely. If we wanted to deploy some customized error handling to change this behavior, you can do so by placing this function inside of a Try/Catch statement.