Catch exception when creating new invoice with GetLNURL

This commit is contained in:
nicolas.dorier 2023-02-08 20:45:05 +09:00
parent 82b36aaca7
commit bb1138efb5
No known key found for this signature in database
GPG Key ID: 6618763EF09186FE

View File

@ -418,8 +418,15 @@ namespace BTCPayServer
OrderId = AppService.GetAppOrderId(app)
}.ToJObject();
}
var i = await _invoiceController.CreateInvoiceCoreRaw(invoiceRequest, store, Request.GetAbsoluteRoot(), additionalTags);
InvoiceEntity i;
try
{
i = await _invoiceController.CreateInvoiceCoreRaw(invoiceRequest, store, Request.GetAbsoluteRoot(), additionalTags);
}
catch (Exception e)
{
return this.CreateAPIError(null, e.Message);
}
if (i.Type != InvoiceType.TopUp)
{
min = i.GetPaymentMethod(pmi).Calculate().Due.ToDecimal(MoneyUnit.Satoshi);