Show rate error to the model in WalletSend

This commit is contained in:
nicolas.dorier
2018-07-27 00:32:09 +09:00
parent 52f60b0457
commit 86644d38d7
3 changed files with 7 additions and 2 deletions

View File

@@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<Version>1.0.2.74</Version>
<Version>1.0.2.75</Version>
<NoWarn>NU1701,CA1816,CA1308,CA1810,CA2208</NoWarn>
</PropertyGroup>
<ItemGroup>

View File

@@ -167,8 +167,12 @@ namespace BTCPayServer.Controllers
model.Divisibility = _currencyTable.GetNumberFormatInfo(currencyPair.Right, true).CurrencyDecimalDigits;
model.Fiat = currencyPair.Right;
}
else
{
model.RateError = $"{result.EvaluatedRule} ({string.Join(", ", result.Errors.OfType<object>().ToArray())})";
}
}
catch { }
catch(Exception ex) { model.RateError = ex.Message; }
}
return View(model);
}

View File

@@ -18,5 +18,6 @@ namespace BTCPayServer.Models.WalletViewModels
public decimal? Rate { get; set; }
public int Divisibility { get; set; }
public string Fiat { get; set; }
public string RateError { get; set; }
}
}