mirror of
https://github.com/aljazceru/BTCPayServerPlugins.git
synced 2025-12-17 07:34:24 +01:00
Report errors from Blink
This commit is contained in:
@@ -645,11 +645,16 @@ mutation LnInvoicePaymentSend($input: LnInvoicePaymentInput!) {
|
|||||||
null => PayResult.Unknown,
|
null => PayResult.Unknown,
|
||||||
_ => throw new ArgumentOutOfRangeException()
|
_ => throw new ArgumentOutOfRangeException()
|
||||||
};
|
};
|
||||||
if (result.Result == PayResult.Error && response.TryGetValue("errors", out var error) && error.ToString().Contains("ResourceAttemptsRedlockServiceError", StringComparison.InvariantCultureIgnoreCase))
|
if (result.Result == PayResult.Error && response.TryGetValue("errors", out var error))
|
||||||
|
{
|
||||||
|
if (error.ToString().Contains("ResourceAttemptsRedlockServiceError", StringComparison.InvariantCultureIgnoreCase))
|
||||||
{
|
{
|
||||||
await Task.Delay(Random.Shared.Next(200, 600), cts.Token);
|
await Task.Delay(Random.Shared.Next(200, 600), cts.Token);
|
||||||
return await Pay(bolt11, payParams, cts.Token);
|
return await Pay(bolt11, payParams, cts.Token);
|
||||||
}
|
}
|
||||||
|
if (error is JArray { Count: > 0 } arr)
|
||||||
|
result.ErrorDetail = arr[0]["message"]?.Value<string>();
|
||||||
|
}
|
||||||
if (response["transaction"]?.Value<JObject>() is not null)
|
if (response["transaction"]?.Value<JObject>() is not null)
|
||||||
{
|
{
|
||||||
result.Details = new PayDetails()
|
result.Details = new PayDetails()
|
||||||
|
|||||||
Reference in New Issue
Block a user