mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-01-18 13:26:47 +01:00
f8f98ab7f0
* Allow overrides on all methods * Add non-returning SendHttpRequest methods * Use SendHttpRequest consistently * Use file-scoped namespace * Rates: Set default null value for currencyPair * Ensure it works with instances which have BTCPAY_ROOTPATH set
27 lines
745 B
C#
27 lines
745 B
C#
using System;
|
|
using System.Text;
|
|
using BTCPayServer.Client.Models;
|
|
|
|
namespace BTCPayServer.Client;
|
|
|
|
public class GreenfieldValidationException : Exception
|
|
{
|
|
public GreenfieldValidationException(GreenfieldValidationError[] errors) : base(BuildMessage(errors))
|
|
{
|
|
ValidationErrors = errors;
|
|
}
|
|
|
|
private static string BuildMessage(GreenfieldValidationError[] errors)
|
|
{
|
|
if (errors == null) throw new ArgumentNullException(nameof(errors));
|
|
var builder = new StringBuilder();
|
|
foreach (var error in errors)
|
|
{
|
|
builder.AppendLine($"{error.Path}: {error.Message}");
|
|
}
|
|
return builder.ToString();
|
|
}
|
|
|
|
public GreenfieldValidationError[] ValidationErrors { get; }
|
|
}
|