c# - how to make sure a variable is set to a value and it can if tested in catch block -


I am writing a certificate with a simple requirement, where I load an account, to start paying Call a webservice and if there is a successful update in this account balance

The intention of the following code is to ensure that there is some reversal if the web service call has succeeded in getting the money from the customer's bank But the account could not be saved due to the concurrency issue. However, I have this strange issue that if the response is successful, then if the test in the catch block returns and throws an exception again? / Code> accountService.Save (account) is on the line, currentStatus < / Code> WEBSERVICE_SUCCESSFUL

End of editing:

This is a web application And the process () is triggered from the front end, am I clarifying something? Any help would really be appreciated.

  function zero process (account account, string parameter 1, decimal paragraph 2) {string currentStatus = "START"; Try {log ("start web service call"); Var response = webservice.Call (Ultimate, Ultimate 2); Logs ("and web service call"); If (response.Is successful) {currentStatus = "WEBSERVICE_SUCCESSFUL"; // Update Account Balance Account Service Save (account); } Else {// do something else}} hold (ConcurrencyException ex) {log ("error concurrency .."); If (current status == "WEBSERVICE_SUCCESSFUL") // mutated and left the other; }}    

accountService.Save (account) function one And throwing exceptions, catch blocks do not catch them. In this case, try changing the concurrencyException to exception

Comments