Skip to main content
Open

HttpCaller 404 isn't always an error

Related products:Transformers

tomcolley
Contributor

As mentioned in other posts, HttpCaller can be used to check for the existence of an API resource, in which case a 404 response is not an error.

I often use this approach in upload workflows where I need to check if a layer already exists in Geoserver and needs to be refreshed or if it needs to be created. The alternative of making a call to list out all of the layers and then parsing that list to see if the one I’m interested in is there is much slower.

It would be great to have an option to output 404s (and potentially other response codes) to custom output ports, rather than rejecting and raising an error.

 

132 2024-6-4 01:01:38 | upload_checker_2_HTTPCaller_2 (HTTPFactory): [51]: HTTP transfer summary (*.*.*): status code: 404, download size: 91 bytes, DNS lookup time: 4 ms, total transfer time: 68 ms
133 2024-6-4 01:01:38 | upload_checker_2_HTTPCaller_2 (HTTPFactory): An error occurred while accessing the URL

 

Httpcaller Error | Community (safe.com)

Ability to change transformer, reader and writer logging level | Community (safe.com)

jkr_wrk
Influencer
Forum|alt.badge.img+28

But if you connect your rejected to the same transformer than the output, your problem is solved, isn't it?

I also like to prevent features leaving through the rejected port, but FME does not really care.

But indeed accepting all error codes checkbox could be fine for some implementations, simply check the status code afterward.


tomcolley
Contributor
Forum|alt.badge.img+4
  • Contributor
  • June 12, 2024
jkr_wrk wrote:

But if you connect your rejected to the same transformer than the output, your problem is solved, isn't it?

I also like to prevent features leaving through the rejected port, but FME does not really care.

But indeed accepting all error codes checkbox could be fine for some implementations, simply check the status code afterward.

 

Yep, it works fine to output through the rejected port and carry on, but it doesn’t seem ‘right’ to me.

I think it’s quite dangerous to normalise warnings/errors in workbenches because then you start to ignore them and possibly miss genuine things that have gone wrong.

In my case, this workbench is part of an automated upload flow that runs hundreds of times a day. If there’s ever an issue with one of these uploads, I’ll go into FME Flow and look at the jobs that have run and rather than being able to easily see the issue, every single job has multiple errors against it.

 

 


LizAtSafe
Safer
Forum|alt.badge.img+15
NewOpen


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings