From f267ab17359f2feb92e65e504d9f9b0c47772846 Mon Sep 17 00:00:00 2001 From: Rikki Tooley Date: Tue, 23 Dec 2014 00:07:37 +0000 Subject: [PATCH] Remove CatchRequestExceptions option, closes #23 --- .../Api/Commands/GetAsyncCommandBase.cs | 11 ++--------- .../Api/Commands/PostAsyncCommandBase.cs | 9 +-------- src/IF.Lastfm.Core/LastFm.cs | 11 ----------- 3 files changed, 3 insertions(+), 28 deletions(-) diff --git a/src/IF.Lastfm.Core/Api/Commands/GetAsyncCommandBase.cs b/src/IF.Lastfm.Core/Api/Commands/GetAsyncCommandBase.cs index 0446ee0..abe1022 100644 --- a/src/IF.Lastfm.Core/Api/Commands/GetAsyncCommandBase.cs +++ b/src/IF.Lastfm.Core/Api/Commands/GetAsyncCommandBase.cs @@ -14,7 +14,7 @@ protected GetAsyncCommandBase(ILastAuth auth) Auth = auth; } - public async override Task ExecuteAsync() + public override async Task ExecuteAsync() { SetParameters(); @@ -30,14 +30,7 @@ public async override Task ExecuteAsync() } catch (HttpRequestException) { - if (LastFm.CatchRequestExceptions) - { - return LastResponse.CreateErrorResponse(LastFmApiError.RequestFailed); - } - else - { - throw; - } + throw; } } diff --git a/src/IF.Lastfm.Core/Api/Commands/PostAsyncCommandBase.cs b/src/IF.Lastfm.Core/Api/Commands/PostAsyncCommandBase.cs index 0520208..d03cb5c 100644 --- a/src/IF.Lastfm.Core/Api/Commands/PostAsyncCommandBase.cs +++ b/src/IF.Lastfm.Core/Api/Commands/PostAsyncCommandBase.cs @@ -39,14 +39,7 @@ public override async Task ExecuteAsync() } catch (HttpRequestException) { - if (LastFm.CatchRequestExceptions) - { - return LastResponse.CreateErrorResponse(LastFmApiError.RequestFailed); - } - else - { - throw; - } + return LastResponse.CreateErrorResponse(LastFmApiError.RequestFailed); } } } diff --git a/src/IF.Lastfm.Core/LastFm.cs b/src/IF.Lastfm.Core/LastFm.cs index db6e97b..18b4ac6 100644 --- a/src/IF.Lastfm.Core/LastFm.cs +++ b/src/IF.Lastfm.Core/LastFm.cs @@ -27,17 +27,6 @@ public class LastFm #endregion - /// - /// Determines whether commands should throw HttpRequestExceptions or wrap them - /// in the response. - /// - /// Using this can make client code neater, but it violates the principles of - /// separation of concerns and single responsibility a bit. This property won't - /// get removed but please only use it if you understand what it does! - /// - [Obsolete] - public static bool CatchRequestExceptions { get; set; } - #region Api helper methods public static string FormatApiUrl(string method, string apikey, Dictionary parameters = null, bool secure = false)