How to Handle REST / GET errors

I’m using an GET node to do an http get from https://api.deezer.com/2.0/track/isrc:GBF088500674 to verify if it is a valid ISRC number… (I’ll feed this from a list of numbers)

If the ISRC number if correct then a JSON object is returned with information about the music track and I use the JSON Path node to get to the data I want. Works fine. When the ISRC number is invalid, then a different JSON structure is returned;

{“error”: {
“type”: “DataException”,
“message”: “no data”,
“code”: 800
}}

This is expected. In this case, I want to be able to detect that the ISRC number is ni valid. What the best practice on this? Is there an example workflow?

Thanks
dpr

Hi @dpr,

You can use the Row Splitter node with the following dialog configuration:

  • Include (Exclude) rows by attribute value

  • Column to test: the column containing your JSON response

  • Use pattern matching with “contains wild cards” option selected and *error* pattern

This way you will have different responses split and can treat them in accordance with your needs afterwards.

Best,
Anna

Thanks!

Any ideas on how to handle these more complicated sites:

https://isrclookup.ppluk.com/faces/pages/search.xhtml

https://isrcsearch.ifpi.org/#!/search?isrcCode=GBA077700010&tab=lookup&showReleases=0&start=0&number=10

These need some kind of a scrapper?

Thanks again.
Dpr

Hi @dpr -

Sounds like you may have a use for the Palladian and/or Selenium nodes. Here’s a post from @qqilihq a while back that talks about them some - he may be able to provide some more recent info.

2 Likes