Skip to content

Commit

Permalink
better exception
Browse files Browse the repository at this point in the history
  • Loading branch information
tmasternak authored and bording committed Jul 8, 2020
1 parent 7a3f2e9 commit 55412c0
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public static void ThrowIfNameIsTooLong(string name)
{
if (Encoding.UTF8.GetByteCount(name) > 255)
{
throw new Exception($"{name} exceeds 255 bytes which is maximal length for a queue or an exchange.");
throw new ArgumentOutOfRangeException(nameof(name), name, "Value exceeds the maximum allowed length of 255 bytes.");
}
}
}
Expand Down

0 comments on commit 55412c0

Please sign in to comment.