Skip to content

Commit

Permalink
Add detailed error message corresponding to the IndexOutOfBoundsExcep…
Browse files Browse the repository at this point in the history
…tion while calling getEntry(...) (netty#10386)

Motivation:
`getEntry(...)` may throw an IndexOutOfBoundsException without any error messages.


Modification:

Add detailed error message corresponding to the IndexOutOfBoundsException while calling `getEntry(...)` in HpackDynamicTable.java.

Result: 

Easier to debug
  • Loading branch information
seedeed authored Jul 6, 2020
1 parent 9893ac7 commit 7a05aa1
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public long capacity() {
*/
public HpackHeaderField getEntry(int index) {
if (index <= 0 || index > length()) {
throw new IndexOutOfBoundsException();
throw new IndexOutOfBoundsException("Index " + index + " out of bounds for length " + length());
}
int i = head - index;
if (i < 0) {
Expand Down

0 comments on commit 7a05aa1

Please sign in to comment.