0

I have a Winforms app that calls a method in a Web API app like so:

private async Task SavePlatypusComplianceFileOnServer(string year, string month)
{
    string monthAsMM = ReportRunnerConstsAndUtils.GetMonthAsMM(month);
    HttpClient client = new HttpClient();

    client.BaseAddress = new Uri(ReportRunnerConstsAndUtils.SERVER_BASE_ADDRESS);

    String uriToCall = String.Format("/api/PlatypusCompliance/{0}/{1}{2}", _unit, year, monthAsMM);

    HttpResponseMessage response = await client.PostAsync(uriToCall, null);
}

Right after making that call (which calls a stored procedure), the client also calls the same stored procedure. It is probably for this reason (I reckon) that I get an exception message that a temporary table referenced in the stored procedure cannot be dropped because I don't have permissions (nor do I have persimmons, but that is by design, as I don't care for them unless they have been used to make cookies).

However, even though the call to the stored procedure is presumably aborted at this point, the process still works: the server (Web API app) successfully does what it is supposed to do (save the data returned from the stored procedure as HTML) and the client (Winforms app) is also successful in generating an Excel spreadsheet and attaching it to an email.

So my question (besides "why is it working when it says it has failed") is: should I care about this exception msg? Should I suppress it so that the user won't see it? Or will it not be seen by the user anyway?

svick
  • 236,525
  • 50
  • 385
  • 514
B. Clay Shannon-B. Crow Raven
  • 8,547
  • 144
  • 472
  • 862

0 Answers0