chore: initial commit

This commit is contained in:
Matthias Langhard
2020-12-07 22:00:24 +01:00
commit 75a687e31e
20 changed files with 507 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
using System.Net.Http;
using System.Threading.Tasks;
using Novaloop.PaymoApi.Exceptions;
namespace Novaloop.PaymoApi.Extensions
{
internal static class HttpResponseMessageExtensions
{
internal static async Task ThrowExceptionWithDetailsIfUnsuccessful(this HttpResponseMessage response)
{
if (!response.IsSuccessStatusCode)
{
throw new PaymoApiException((int) response.StatusCode, await response.Content.ReadAsStringAsync());
}
}
}
}