diff --git a/Communication/DaemonCommander.cs b/Communication/DaemonCommander.cs index 5deca9d..5228230 100755 --- a/Communication/DaemonCommander.cs +++ b/Communication/DaemonCommander.cs @@ -94,7 +94,7 @@ public static bool GetPullSecret() { ae.Handle((x) => { - if (x is NotFoundException) // This we know how to handle. + if (x is APINotFoundException) // This we know how to handle. { // Marking as handled return true; @@ -140,12 +140,12 @@ private static async Task postResponse(string cmd, string content, int t case HttpStatusCode.InternalServerError: throw new APIException(body); case HttpStatusCode.NotFound: - throw new NotFoundException(body); + throw new APINotFoundException(body); } } catch (TimeoutException e) { - throw new CommunicationException(e.Message); + throw new APICommunicationException(e.Message); } catch (Exception e) { @@ -174,12 +174,12 @@ private static async Task getResponse(string cmd, int timeout) case HttpStatusCode.InternalServerError: throw new APIException(body); case HttpStatusCode.NotFound: - throw new NotFoundException(body); + throw new APINotFoundException(body); } } catch (TimeoutException e) { - throw new CommunicationException(e.Message); + throw new APICommunicationException(e.Message); } catch (Exception e) { diff --git a/Communication/Exceptions.cs b/Communication/Exceptions.cs index e383000..e9c5f13 100755 --- a/Communication/Exceptions.cs +++ b/Communication/Exceptions.cs @@ -2,21 +2,21 @@ namespace CRCTray.Communication { - internal class NotFoundException : Exception + internal class APIException : Exception { - public NotFoundException(string message) : base(message) { } + public APIException(string message) : base(message) { } } - internal class APIException : Exception + internal class APINotFoundException : Exception { - public APIException(string message) : base(message) { } + public APINotFoundException(string message) : base(message) { } } - internal class CommunicationException : Exception + internal class APICommunicationException : Exception { - public CommunicationException(string message) : base(message) { } + public APICommunicationException(string message) : base(message) { } } diff --git a/Helpers/TaskHelpers.cs b/Helpers/TaskHelpers.cs index 919d387..4c92570 100755 --- a/Helpers/TaskHelpers.cs +++ b/Helpers/TaskHelpers.cs @@ -25,7 +25,7 @@ public static async Task TryTaskAndNotify(Func function, string success { ae.Handle((x) => { - if (x is CommunicationException) // This we know how to handle. + if (x is APICommunicationException) // This we know how to handle. { // TODO: start counting and eventually notify @@ -73,7 +73,7 @@ public static async Task TryTaskAndNotify(Func function, { ae.Handle((x) => { - if (x is CommunicationException) // This we know how to handle. + if (x is APICommunicationException) // This we know how to handle. { // TODO: start counting and eventually notify