Augment webhook test error message

This commit is contained in:
Umar Bolatov 2021-04-25 20:30:10 -07:00
parent 9f6f74df59
commit 4671f08b64
No known key found for this signature in database
GPG Key ID: 2C1F9AEB371D2A28
2 changed files with 8 additions and 2 deletions

View File

@ -128,7 +128,7 @@ namespace BTCPayServer.Controllers
if (result.Success) {
TempData[WellKnownTempData.SuccessMessage] = $"{viewModel.Type.ToString()} event delivered successfully!";
} else {
TempData[WellKnownTempData.ErrorMessage] = $"{viewModel.Type.ToString()} event could not be delivered";
TempData[WellKnownTempData.ErrorMessage] = $"{viewModel.Type.ToString()} event could not be delivered. Error message received: {(result.ErrorMessage ?? "unknown")}";
}
return View(nameof(TestWebhook));

View File

@ -299,6 +299,7 @@ namespace BTCPayServer.HostedServices
{
public string? DeliveryId { get; set; }
public bool Success { get; set; }
public string? ErrorMessage { get; set; }
}
private async Task<DeliveryResult> SendDelivery(WebhookDeliveryRequest ctx)
@ -338,7 +339,12 @@ namespace BTCPayServer.HostedServices
}
ctx.Delivery.SetBlob(deliveryBlob);
return new DeliveryResult() { Success = deliveryBlob.ErrorMessage is null, DeliveryId = ctx.Delivery.Id };
return new DeliveryResult()
{
Success = deliveryBlob.ErrorMessage is null,
DeliveryId = ctx.Delivery.Id,
ErrorMessage = deliveryBlob.ErrorMessage
};
}