private static string CreateExceptionMessage(MollieErrorMessage error) { if (!String.IsNullOrEmpty(error.Field)) { return($"Error occured in field: {error.Field} - {error.Message}"); } return(error.Message); }
public MollieApiException(string json) : base(ParseErrorMessage(json).ToString()) { Details = ParseErrorMessage(json); }
public MollieApiException(string json) : base(CreateExceptionMessage(ParseErrorJsonResponse(json))) { this.Details = ParseErrorJsonResponse(json); }
public MollieApiException(string json) : base("Exception occured while communicating with Mollie API. View the Details property for more information") { this.Details = JsonConvert.DeserializeObject <MollieErrorMessage>(json); }