Remove another Throwable abuse

This commit is contained in:
Dylan K. Taylor
2019-01-17 22:43:52 +00:00
parent 2dee7e9e0f
commit c5df2f6f0d
2 changed files with 40 additions and 37 deletions

View File

@ -32,6 +32,7 @@ use function is_resource;
use function strftime;
use function strtolower;
use function time;
use function trim;
class BanList{
@ -156,14 +157,14 @@ class BanList{
if($line{0} !== "#"){
try{
$entry = BanEntry::fromString($line);
if($entry instanceof BanEntry){
if($entry !== null){
$this->list[$entry->getName()] = $entry;
}
}catch(\Throwable $e){
}catch(\RuntimeException $e){
$logger = \GlobalLogger::get();
$logger->critical("Failed to parse ban entry from string \"$line\": " . $e->getMessage());
$logger->logException($e);
$logger->critical("Failed to parse ban entry from string \"" . trim($line) . "\": " . $e->getMessage());
}
}
}
fclose($fp);