~ruther/NosSmooth

3d723b7e727957805ec809cbe86e69ba076e3f6d — František Boháček 3 years ago 5a9c710
feat: add possibility to add reason to PacketParameterSerializerError
1 files changed, 3 insertions(+), 2 deletions(-)

M Core/NosSmooth.Packets/Errors/PacketParameterSerializerError.cs
M Core/NosSmooth.Packets/Errors/PacketParameterSerializerError.cs => Core/NosSmooth.Packets/Errors/PacketParameterSerializerError.cs +3 -2
@@ 16,5 16,6 @@ namespace NosSmooth.Packets.Errors;
/// <param name="Converter">The converter that could not deserialize the parameter.</param>
/// <param name="PropertyName">The name of the property.</param>
/// <param name="Result">The underlying result.</param>
public record PacketParameterSerializerError(ITypeConverter Converter, string PropertyName, IResult Result)
    : ResultError($"There was an error deserializing property {PropertyName} in converter {Converter.GetType().FullName}");
\ No newline at end of file
/// <param name="Reason">The reason for the error, if known.</param>
public record PacketParameterSerializerError(ITypeConverter Converter, string PropertyName, IResult Result, string? Reason = null)
    : ResultError($"There was an error deserializing property {PropertyName} in converter {Converter.GetType().FullName}{(Reason is not null ? (", reason: " + Reason) : string.Empty)}");
\ No newline at end of file

Do not follow this link