From 520458beaec0d8dea2cb8825bf48c872db985394 Mon Sep 17 00:00:00 2001 From: Alexey Shpakovsky Date: Fri, 28 May 2021 23:22:23 +0200 Subject: [PATCH] be more clear about errors --- abook_class.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/abook_class.php b/abook_class.php index e364429..c7661b1 100755 --- a/abook_class.php +++ b/abook_class.php @@ -69,7 +69,7 @@ class abook_carddav extends addressbook_backend { $this->listing = $param['listing']; } - $this->open(true); + return $this->open(true); } else { return $this->set_error('Invalid argument to constructor'); @@ -87,12 +87,10 @@ class abook_carddav extends addressbook_backend { $discover = new Discovery(); $abooks = $discover->discoverAddressbooks($this->account); } catch (\Exception $e) { - // $log->error("!!! Error during addressbook discovery: " . $e->getMessage()); - exit(1); + return $this->set_error("!!! Error during addressbook discovery: " . $e->getMessage()); } if (count($abooks) <= 0) { - // $log->warning("Cannot proceed because no addressbooks were found - exiting"); - exit(0); + return $this->set_error("Cannot proceed because no addressbooks were found - exiting"); } ////////////////////////////////////////////////////////// // THE FOLLOWING SHOWS HOW TO PERFORM A SYNCHRONIZATION //