From 59295f9cae6025dda947f48d4c7f84421cbcd3d3 Mon Sep 17 00:00:00 2001 From: Alexey Shpakovsky Date: Fri, 28 May 2021 23:07:55 +0200 Subject: [PATCH] aggressive error logging during startup --- abook_class.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/abook_class.php b/abook_class.php index e364429..7514031 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,15 @@ 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); + echo "Error during addressbook discovery: " . $e->getMessage(); + return $this->set_error(_("Error during addressbook discovery: ") . $e->getMessage()); + // exit(1); } if (count($abooks) <= 0) { // $log->warning("Cannot proceed because no addressbooks were found - exiting"); - exit(0); + echo "Cannot proceed because no addressbooks were found - exiting"; + return $this->set_error(_("Cannot proceed because no addressbooks were found - exiting")); + // exit(0); } ////////////////////////////////////////////////////////// // THE FOLLOWING SHOWS HOW TO PERFORM A SYNCHRONIZATION //