Add detailed error message corresponding to the IndexOutOfBoundsException while calling getEntry(...) (#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
This commit is contained in:
parent
9893ac726f
commit
7a05aa1cf8
@ -83,7 +83,7 @@ final class HpackDynamicTable {
|
|||||||
*/
|
*/
|
||||||
public HpackHeaderField getEntry(int index) {
|
public HpackHeaderField getEntry(int index) {
|
||||||
if (index <= 0 || index > length()) {
|
if (index <= 0 || index > length()) {
|
||||||
throw new IndexOutOfBoundsException();
|
throw new IndexOutOfBoundsException("Index " + index + " out of bounds for length " + length());
|
||||||
}
|
}
|
||||||
int i = head - index;
|
int i = head - index;
|
||||||
if (i < 0) {
|
if (i < 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user