Skip to content

Commit 33aab19

Browse files
authored
Merge pull request #112 from maxmind/greg/improved-message
Improve exception message
2 parents bbafd7c + 7d42315 commit 33aab19

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/MaxMind/Db/Reader.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,9 @@ private function findAddressInTree(string $ipAddress): array
215215
// Record is a data pointer
216216
return [$node, $i];
217217
}
218-
throw new InvalidDatabaseException('Something bad happened');
218+
throw new InvalidDatabaseException(
219+
'Invalid or corrupt database. Maximum search depth reached without finding a leaf node'
220+
);
219221
}
220222

221223
private function ipV4StartNode(): int

0 commit comments

Comments
 (0)