Forum Discussion

bstock's avatar
bstock
Frequent Visitor
6 years ago
Solved

Handle an error in a custom function

I have a custom function that queries an API for some data and loads it into a table.  I plan on using this function as a column (invoke custom function) to query data from the API based on the usern...
  • edhans's avatar
    edhans
    6 years ago

    PQ will not automatacally handle the errors, by design. What should it do? Replace with null, replace with blank, replace with the word "Error?"

     

    The Try/Otherwise construct is exactly for trapping errors and you could use:

    try HereIsSomeMath otherwise null

     

    and if it gets an error, it will replace with null. It is a good error handler. LIke IFERROR() in Excel.