Don't crash the whole catalog if one book doesn't parse correctly

This commit is contained in:
Alex Cabal 2019-08-16 15:57:54 -05:00
parent 876234ef9c
commit f8da23ab9d

View file

@ -112,8 +112,13 @@ class Library{
$ebook = apcu_fetch('ebook-' . $ebookWwwFilesystemPath);
}
catch(Safe\Exceptions\ApcuException $ex){
$ebook = new Ebook($ebookWwwFilesystemPath);
apcu_store('ebook-' . $ebookWwwFilesystemPath, $ebook);
try{
$ebook = new Ebook($ebookWwwFilesystemPath);
apcu_store('ebook-' . $ebookWwwFilesystemPath, $ebook);
}
catch(InvalidEbookException $ieEx){
// Do nothing if one specific ebook is causing problems
}
}
$ebooks[] = $ebook;