Skip to content

Commit

Permalink
fix log for ClientApiException
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaliidasaev committed May 8, 2020
1 parent 25bbfae commit 4bab5f5
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
using System.Net;
using MAVN.Service.PayrexxIntegration.Domain.Enums;
using Common;
using Lykke.Common.ApiLibrary.Exceptions;

namespace MAVN.Service.PayrexxIntegration.Controllers
{
Expand Down Expand Up @@ -125,10 +126,10 @@ public async Task<PaymentResponse> GeneratePaymentAsync([FromBody] GeneratePayme
SkipResultPage = true
};

var res = await client.Api.CreatePaymentGatewayAsync(paymentGatewayRequest);

_log.Info("Call CreatePaymentGatewayAsync with data: " + paymentGatewayRequest.ToJson());

var res = await client.Api.CreatePaymentGatewayAsync(paymentGatewayRequest);

var payment = res.Data[0];

return new PaymentResponse
Expand All @@ -137,6 +138,14 @@ public async Task<PaymentResponse> GeneratePaymentAsync([FromBody] GeneratePayme
PaymentPageUrl = payment.Link,
};
}
catch (ClientApiException e)
{
_log.Warning("ClientApiException with data: " + e.ToJson(), exception: e);
return new PaymentResponse
{
ErrorCode = CheckIntegrationErrorCode.Fail,
};
}
catch (Exception e)
{
_log.Warning(null, exception: e);
Expand Down

0 comments on commit 4bab5f5

Please sign in to comment.