Add logging for deserialization
This commit is contained in:
1 parent
cc7d2d478c
commit
8c137115f4
4 files changed
+28
-8
No files matched your search
@@ -89,8 +89,17 @@ namespace mROA.Cbor
|
||||
|
||||
public object? Deserialize(ReadOnlyMemory<byte> rawMemory, Type type, IEndPointContext? context)
|
||||
{
|
||||
var reader = new CborReader(rawMemory);
|
||||
return ReadData(reader, type, context);
|
||||
try
|
||||
{
|
||||
var reader = new CborReader(rawMemory);
|
||||
return ReadData(reader, type, context);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine($"Bad deserialization. Bytes: {rawMemory.ToArray().Select(b => $"{b:X}")}");
|
||||
throw;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public T Cast<T>(object nonCasted, IEndPointContext? context)
|
||||
|
||||
Reference in new issue
Block a user