Skip to content

Commit

Permalink
Add AddBytes ArgumentException custom message
Browse files Browse the repository at this point in the history
  • Loading branch information
xzippyzachx committed Jan 28, 2024
1 parent d6987a8 commit 1fc17d4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion RiptideNetworking/RiptideNetworking/Message.cs
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ public Message AddBytes(byte[] array, int startIndex, int amount, bool includeLe
throw new ArgumentOutOfRangeException(nameof(startIndex));

if (startIndex + amount > array.Length)
throw new ArgumentException(nameof(amount), ArrayNotLongEnoughError(amount, array.Length, startIndex, ByteName));
throw new ArgumentException(nameof(amount), $"The source array is not long enough to read {amount} {Helper.CorrectForm(amount, ByteName)} starting at {startIndex}!");

if (includeLength)
AddVarULong((uint)amount);
Expand Down

0 comments on commit 1fc17d4

Please sign in to comment.