From 627f90c0e208fad710882301273fa639efa47c70 Mon Sep 17 00:00:00 2001 From: Mike Colagrosso Date: Tue, 22 Oct 2024 16:37:34 -0600 Subject: [PATCH] Add try/catch around Ebook::FromFilesystem() --- scripts/update-ebook-database | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/update-ebook-database b/scripts/update-ebook-database index 2d752a66..b4057143 100755 --- a/scripts/update-ebook-database +++ b/scripts/update-ebook-database @@ -23,7 +23,14 @@ if($verbose){ print("ebookWwwFilesystemPath: $ebookWwwFilesystemPath\n"); } -$ebook = Ebook::FromFilesystem($ebookWwwFilesystemPath); +try{ + $ebook = Ebook::FromFilesystem($ebookWwwFilesystemPath); +} +catch(Exceptions\AppException $appException){ + print("An AppException occurred when updating the ebook database:\n"); + print("\t" . get_class($appException) . ": " . $appException->getMessage() . "\n"); + exit(1); +} if($verbose){ print("Title: $ebook->Title\n");