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,10 +645,15 @@ mutation LnInvoicePaymentSend($input: LnInvoicePaymentInput!) {
|
||||
null => PayResult.Unknown,
|
||||
_ => 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))
|
||||
{
|
||||
await Task.Delay(Random.Shared.Next(200, 600), cts.Token);
|
||||
return await Pay(bolt11, payParams, cts.Token);
|
||||
if (error.ToString().Contains("ResourceAttemptsRedlockServiceError", StringComparison.InvariantCultureIgnoreCase))
|
||||
{
|
||||
await Task.Delay(Random.Shared.Next(200, 600), 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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user