mirror of
https://github.com/standardebooks/web.git
synced 2025-07-10 00:30:28 -04:00
Don't crash the whole catalog if one book doesn't parse correctly
This commit is contained in:
parent
876234ef9c
commit
f8da23ab9d
1 changed files with 7 additions and 2 deletions
|
@ -112,9 +112,14 @@ class Library{
|
||||||
$ebook = apcu_fetch('ebook-' . $ebookWwwFilesystemPath);
|
$ebook = apcu_fetch('ebook-' . $ebookWwwFilesystemPath);
|
||||||
}
|
}
|
||||||
catch(Safe\Exceptions\ApcuException $ex){
|
catch(Safe\Exceptions\ApcuException $ex){
|
||||||
|
try{
|
||||||
$ebook = new Ebook($ebookWwwFilesystemPath);
|
$ebook = new Ebook($ebookWwwFilesystemPath);
|
||||||
apcu_store('ebook-' . $ebookWwwFilesystemPath, $ebook);
|
apcu_store('ebook-' . $ebookWwwFilesystemPath, $ebook);
|
||||||
}
|
}
|
||||||
|
catch(InvalidEbookException $ieEx){
|
||||||
|
// Do nothing if one specific ebook is causing problems
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$ebooks[] = $ebook;
|
$ebooks[] = $ebook;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue