diff --git a/BTCPayServer/Configuration/ExternalServicesOptions.cs b/BTCPayServer/Configuration/ExternalServicesOptions.cs index 9846e82da..efa8b4ce2 100644 --- a/BTCPayServer/Configuration/ExternalServicesOptions.cs +++ b/BTCPayServer/Configuration/ExternalServicesOptions.cs @@ -7,6 +7,5 @@ namespace BTCPayServer.Configuration { public Dictionary OtherExternalServices { get; set; } = new Dictionary(); public ExternalServices ExternalServices { get; set; } = new ExternalServices(); - } } diff --git a/BTCPayServer/Controllers/UIStoresController.LightningLike.cs b/BTCPayServer/Controllers/UIStoresController.LightningLike.cs index aa02b7b41..c06710f74 100644 --- a/BTCPayServer/Controllers/UIStoresController.LightningLike.cs +++ b/BTCPayServer/Controllers/UIStoresController.LightningLike.cs @@ -49,13 +49,24 @@ namespace BTCPayServer.Controllers { var services = _externalServiceOptions.Value.ExternalServices.ToList() .Where(service => _externalServiceTypes.Contains(service.Type)) - .Select(async service => new AdditionalServiceViewModel + .Select(async service => { - DisplayName = service.DisplayName, - ServiceName = service.ServiceName, - CryptoCode = service.CryptoCode, - Type = service.Type.ToString(), - Link = await GetServiceLink(service) + var model = new AdditionalServiceViewModel + { + DisplayName = service.DisplayName, + ServiceName = service.ServiceName, + CryptoCode = service.CryptoCode, + Type = service.Type.ToString() + }; + try + { + model.Link = await GetServiceLink(service); + } + catch (Exception exception) + { + model.Error = exception.Message; + } + return model; }) .Select(t => t.Result) .ToList(); diff --git a/BTCPayServer/Models/AdditionalServiceViewModel.cs b/BTCPayServer/Models/AdditionalServiceViewModel.cs index d72db1606..f87710c7d 100644 --- a/BTCPayServer/Models/AdditionalServiceViewModel.cs +++ b/BTCPayServer/Models/AdditionalServiceViewModel.cs @@ -7,4 +7,5 @@ public class AdditionalServiceViewModel public string ServiceName { get; set; } public string CryptoCode { get; set; } public string Link { get; set; } + public string Error { get; set; } } diff --git a/BTCPayServer/Views/UIStores/Lightning.cshtml b/BTCPayServer/Views/UIStores/Lightning.cshtml index c829234c6..13829b702 100644 --- a/BTCPayServer/Views/UIStores/Lightning.cshtml +++ b/BTCPayServer/Views/UIStores/Lightning.cshtml @@ -45,7 +45,15 @@
@foreach (var service in Model.Services) { - @if (string.IsNullOrEmpty(service.Link)) + @if (!string.IsNullOrEmpty(service.Error)) + { +
+ @service.DisplayName +
@service.DisplayName
+ @service.Error +
+ } + else if (string.IsNullOrEmpty(service.Link)) { @service.DisplayName