diff --git a/src/TgSharp.TL/ObjectDeserializer.cs b/src/TgSharp.TL/ObjectDeserializer.cs index 795bc269..77d785e6 100644 --- a/src/TgSharp.TL/ObjectDeserializer.cs +++ b/src/TgSharp.TL/ObjectDeserializer.cs @@ -18,7 +18,7 @@ public static object DeserializeObject(BinaryReader reader) } catch (Exception ex) { - throw new InvalidDataException("Invalid constructor, or invalid TLContext static initialization", ex); + throw new InvalidDataException($"Unknown object constructor ({Constructor}), this should not happen feel free to post an issue on our Github repository.", ex); } if (t.IsSubclassOf(typeof(TLMethod))) @@ -39,7 +39,8 @@ public static void SerializeObject(object obj, BinaryWriter writer) } public static TLVector<T> DeserializeVector<T>(BinaryReader reader) { - if (reader.ReadInt32() != 481674261) throw new InvalidDataException("Bad Constructor"); + int constructor = reader.ReadInt32(); + if (constructor != 481674261) throw new InvalidDataException($"Incorrect vector constructor, expected {481674261} received {constructor}"); TLVector<T> t = new TLVector<T>(); t.DeserializeBody(reader); return t;