1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-01 08:02:49 -05:00

handle stripe card errors

This commit is contained in:
Kyle Spearrin
2017-04-11 12:27:13 -04:00
parent 96979079ba
commit d69ad2e32e
2 changed files with 26 additions and 0 deletions

View File

@ -47,6 +47,25 @@ namespace Bit.Core.Models.Api
}
}
public ErrorResponseModel(Dictionary<string, IEnumerable<string>> errors)
: this("Errors have occurred.", errors)
{ }
public ErrorResponseModel(string errorKey, string errorValue)
: this(errorKey, new string[] { errorValue })
{ }
public ErrorResponseModel(string errorKey, IEnumerable<string> errorValues)
: this(new Dictionary<string, IEnumerable<string>> { { errorKey, errorValues } })
{ }
public ErrorResponseModel(string message, Dictionary<string, IEnumerable<string>> errors)
: this()
{
Message = message;
ValidationErrors = errors;
}
public string Message { get; set; }
public Dictionary<string, IEnumerable<string>> ValidationErrors { get; set; }
// For use in development environments.