Browse Source

Refactored command-methods.

They throw instead of printing the exception message to the console.
Removed the re-try attempt from GenerateRandomText command-method. It too throws the exception now.
master
Craig Oates 6 years ago
parent
commit
598248a9eb
  1. 7
      WetPancakeCLI/ConsoleCommands.cs

7
WetPancakeCLI/ConsoleCommands.cs

@ -48,8 +48,7 @@ namespace WetPancakeCLI
catch (Exception e)
{
Debug.WriteLine(e.Message);
WriteLine("[WARNING] Unable to complete last request. Re-executing command...");
return FSharpAsync.StartAsTask(RequestRandomTextAsync(), _taskCreationOptions, _cancellationToken).Result;
throw;
}
}
@ -68,7 +67,7 @@ namespace WetPancakeCLI
catch (Exception e)
{
Debug.WriteLine(e.Message);
return e.Message;
throw;
}
}
@ -88,7 +87,7 @@ namespace WetPancakeCLI
catch (Exception e)
{
Debug.WriteLine(e.Message);
return e.Message;
throw;
}
}

Loading…
Cancel
Save