Adding to this post as I have similar issue and concern with REST axis use
We also wanted to try/catch and capture http status code (errors), e.g. 401 and 500
What I found;
If
localddtrace=disabled, then the script ignores the try/catch block, and carries on with the Default branch, as nothing happened (the result set is empty)
06/08/2018 10:53:26:694 DEBUG - 3F6E4BD56365B8650D16D0445FFF9AFF:/RestTest : session id:cbyvapceivrmpp01-2018218095326-12 | RestTest:ExecuteWs | Endpoint URL | RESTConfig:endpointUrl :
https://DOMAIN/WEBSERVICE/ivraries/v1/rest
06/08/2018 10:53:26:711 DEBUG - 3F6E4BD56365B8650D16D0445FFF9AFF:/RestTest : session id:cbyvapceivrmpp01-2018218095326-12 | RestTest:ExecuteWs | Input | GetClientInfo_Input:mrktCd : CZ
06/08/2018 10:53:26:711 DEBUG - 3F6E4BD56365B8650D16D0445FFF9AFF:/RestTest : session id:cbyvapceivrmpp01-2018218095326-12 | RestTest:ExecuteWs | Input | GetClientInfo_Input:langCd : EN
06/08/2018 10:53:26:711 DEBUG - 3F6E4BD56365B8650D16D0445FFF9AFF:/RestTest : session id:cbyvapceivrmpp01-2018218095326-12 | RestTest:ExecuteWs | Input | GetClientInfo_Input:acctNr : 1234
06/08/2018 10:53:27:475 DEBUG - 3F6E4BD56365B8650D16D0445FFF9AFF:/RestTest : session id:cbyvapceivrmpp01-2018218095326-12 | RestTest:AllGood | Output | GetClientInfo_Output:untitled :
If
localddtrace=enabled, then exceptions can be handled, but the log file will be flooded with lot of unnecessary information.
06/08/2018 10:36:26:914 ERROR - F344EC0178D30E1CDB182D072CA62FC5:/RestTest : session id:cbyvapceivrmpp02-2018218093625-16 | RestTest:Error401 | 401 | ddLastException:errorcode : 0
06/08/2018 10:36:26:914 ERROR - F344EC0178D30E1CDB182D072CA62FC5:/RestTest : session id:cbyvapceivrmpp02-2018218093625-16 | RestTest:Error401 | 401 | ddLastException:message : Transport error: 401 Error: Unauthorized
06/08/2018 10:36:26:914 ERROR - F344EC0178D30E1CDB182D072CA62FC5:/RestTest : session id:cbyvapceivrmpp02-2018218093625-16 | RestTest:Error401 | 401 | ddLastException:object : org.apache.axis2.AxisFault: Transport error: 401 Error: Unauthorized
06/08/2018 10:36:26:914 ERROR - F344EC0178D30E1CDB182D072CA62FC5:/RestTest : session id:cbyvapceivrmpp02-2018218093625-16 | RestTest:Error401 | 401 | ddLastException:stacktrace :
org.apache.axis2.AxisFault: Transport error: 401 Error: Unauthorized
In addition, the DDLOG4J.properties file in the project data folder had to have level set to DEBUG manually to capture the error and also allow me to write my own script trace elements.
log4j.logger.Dialog.Designer.TraceWriter.RestTest=
debug, TRestTest
Ideally need ability to capture http status in try/catch but without flooding log files with trace info from DD. Require just our own trace statements for none error situations.
Has there been any updates since this post was first created or resource to review?
Thanks