HTTPConnector handling of error status codes

Support/help with CloverETL (4.9) and CloverDX (5.0 or newer) implementation problems

jsnikeris
Posts: 2
Joined: Mon Mar 16, 2015 8:58 pm

HTTPConnector handling of error status codes

Postby jsnikeris » Thu Apr 02, 2015 9:38 pm

Hi,

When using the HTTPConnector in Clover 4 to POST to a web service, I'm not seeing errors being properly routed to the error port:

16:34:11,720 WARN [HTTPCONNECTOR_5] Returned code for http request http://... is 415
16:34:11,720 INFO [HTTPCONNECTOR_5] Processing response...
16:34:11,722 INFO [HTTPCONNECTOR_5] Executed sucessfully.


What do I need to do to ensure that errors are routed to the error port?

Thanks,
Joe

kubosj
Posts: 372
Joined: Thu Jan 12, 2012 9:10 am

Re: HTTPConnector handling of error status codes

Postby kubosj » Wed Apr 08, 2015 10:22 am

Hi Joe,

Thank you for the email. HTTPConnector does have two output port. The first one is for all type of responses you can basically get - so including 401 etc. Basically anytime the Clover receives a valid response with appropriate code it is sent to the first output port (Output mapping must be defined).
The second output port is used for other sort of exceptions - e.g. when a host is unavailable (produces unknowHostException). This is to handle unexpected situations when you want to keep the graph running (sometime you might only want to fail the graph a "controlled way" and this might be the way you can do it).

Regarding the warning, could you please provide us with the graph (or at least the execution log) so the we can see see the particular warning?

Should you have any further questions please do not hesitate to contact us.
Jaroslav Kubos
CloverCARE Support
CloverETL | Rapid Data Integration

Visit us online at http://www.cloveretl.com

martin_stangler
Posts: 4
Joined: Thu May 21, 2015 12:28 pm

Re: HTTPConnector handling of error status codes

Postby martin_stangler » Thu May 21, 2015 2:14 pm

My solution is to attach Condition component to output port 0 and set Condition property to "$in.0.statusCode >= 200 and $in.0.statusCode < 300" to eval real result. The task I repeat for every HTTPConnector usage and consider to encapsulate this to build a subgraph (after upgrade to v4).

It would be nice to have such property to override HTTPConnector to this befaviour by default. Now literally any server response is considered success, which sadly is hardly true.

Martin

simaj
Posts: 27
Joined: Fri Apr 03, 2015 12:27 pm

Re: HTTPConnector handling of error status codes

Postby simaj » Wed May 27, 2015 9:49 am

Hi Martin,

As there is already an issue in our bug tracker (CLO-1710) for this property, I just voted there for you to raise it's priority.
Jakub Sima
CloverCARE Support
CloverETL | Rapid Data Integration

Visit us online at http://www.cloveretl.com