| | | 1 | | using System.Diagnostics.CodeAnalysis; |
| | | 2 | | |
| | | 3 | | namespace pva.SuperV.Engine.Exceptions |
| | | 4 | | { |
| | | 5 | | /// <summary>Exception thrown when type requested doesn't match actual field type.</summary> |
| | | 6 | | public class StringConversionException : SuperVException |
| | | 7 | | { |
| | | 8 | | public StringConversionException(string fieldName, string? stringValue, Type fieldType) |
| | 11 | 9 | | : base($"Can't convert {stringValue} for {fieldName} with type {fieldType}") |
| | 11 | 10 | | { |
| | 11 | 11 | | } |
| | | 12 | | |
| | | 13 | | public StringConversionException(string fieldName, string? stringValue, List<string>? possibleValues) |
| | 18 | 14 | | : base($"Can't convert {stringValue} for {fieldName}. Possible values are {possibleValues?.Aggregate((a, b) |
| | 6 | 15 | | { |
| | 6 | 16 | | } |
| | | 17 | | |
| | | 18 | | [ExcludeFromCodeCoverage] |
| | | 19 | | public StringConversionException() |
| | | 20 | | { |
| | | 21 | | } |
| | | 22 | | |
| | | 23 | | [ExcludeFromCodeCoverage] |
| | | 24 | | public StringConversionException(string? message) : base(message) |
| | | 25 | | { |
| | | 26 | | } |
| | | 27 | | |
| | | 28 | | [ExcludeFromCodeCoverage] |
| | | 29 | | public StringConversionException(string? message, Exception? innerException) : base(message, innerException) |
| | | 30 | | { |
| | | 31 | | } |
| | | 32 | | } |
| | | 33 | | } |