Skip to content

Commit

Permalink
Throw an appropriate exception (#82)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulpach authored and miwarnec committed Oct 17, 2018
1 parent a49000a commit 470afff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Mirror/Runtime/NetworkReader.cs
Expand Up @@ -61,7 +61,7 @@ public UInt32 ReadPackedUInt32()
UInt64 value = ReadPackedUInt64();
if (value > UInt32.MaxValue)
{
throw new IndexOutOfRangeException("ReadPackedUInt32() failure, value too large");
throw new InvalidDataException("ReadPackedUInt32() failure, value too large");
}
return (UInt32)value;
}
Expand Down Expand Up @@ -122,7 +122,7 @@ public UInt64 ReadPackedUInt64()
return a1 + (((UInt64)a2) << 8) + (((UInt64)a3) << 16) + (((UInt64)a4) << 24) + (((UInt64)a5) << 32) + (((UInt64)a6) << 40) + (((UInt64)a7) << 48) + (((UInt64)a8) << 56);
}

throw new IndexOutOfRangeException("ReadPackedUInt64() failure: " + a0);
throw new InvalidDataException("ReadPackedUInt64() failure: " + a0);
}

public Vector2 ReadVector2()
Expand Down

0 comments on commit 470afff

Please sign in to comment.