mirror of
https://github.com/Sarsoo/IF.Lastfm.git
synced 2024-10-17 07:13:09 +01:00
Remove CatchRequestExceptions option, closes #23
This commit is contained in:
parent
063a7466a0
commit
f267ab1735
@ -14,7 +14,7 @@ protected GetAsyncCommandBase(ILastAuth auth)
|
||||
Auth = auth;
|
||||
}
|
||||
|
||||
public async override Task<T> ExecuteAsync()
|
||||
public override async Task<T> ExecuteAsync()
|
||||
{
|
||||
SetParameters();
|
||||
|
||||
@ -30,14 +30,7 @@ public async override Task<T> ExecuteAsync()
|
||||
}
|
||||
catch (HttpRequestException)
|
||||
{
|
||||
if (LastFm.CatchRequestExceptions)
|
||||
{
|
||||
return LastResponse.CreateErrorResponse<T>(LastFmApiError.RequestFailed);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw;
|
||||
}
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -39,14 +39,7 @@ public override async Task<T> ExecuteAsync()
|
||||
}
|
||||
catch (HttpRequestException)
|
||||
{
|
||||
if (LastFm.CatchRequestExceptions)
|
||||
{
|
||||
return LastResponse.CreateErrorResponse<T>(LastFmApiError.RequestFailed);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw;
|
||||
}
|
||||
return LastResponse.CreateErrorResponse<T>(LastFmApiError.RequestFailed);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -27,17 +27,6 @@ public class LastFm
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 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!
|
||||
/// </summary>
|
||||
[Obsolete]
|
||||
public static bool CatchRequestExceptions { get; set; }
|
||||
|
||||
#region Api helper methods
|
||||
|
||||
public static string FormatApiUrl(string method, string apikey, Dictionary<string, string> parameters = null, bool secure = false)
|
||||
|
Loading…
Reference in New Issue
Block a user