From cd58860dcbc2ef75cca6a3d626aa3a77d8f90d47 Mon Sep 17 00:00:00 2001 From: Demian Katz <demian.katz@villanova.edu> Date: Tue, 3 Jul 2012 10:59:40 -0400 Subject: [PATCH] Fixed namespace issues in exception handling. --- module/VuFind/src/VuFind/Account/Manager.php | 4 ++-- module/VuFind/src/VuFind/Connection/Solr.php | 2 +- module/VuFind/src/VuFind/Search/Base/Results.php | 2 +- module/VuFind/src/VuFind/Theme/Root/Helper/AuthorNotes.php | 2 +- module/VuFind/src/VuFind/Theme/Root/Helper/Citation.php | 2 +- module/VuFind/src/VuFind/Theme/Root/Helper/Excerpt.php | 2 +- module/VuFind/src/VuFind/Theme/Root/Helper/Reviews.php | 4 ++-- module/VuFind/src/VuFind/Theme/Root/Helper/VideoClips.php | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/module/VuFind/src/VuFind/Account/Manager.php b/module/VuFind/src/VuFind/Account/Manager.php index 4eeb3e9d63c..68b93f4376e 100644 --- a/module/VuFind/src/VuFind/Account/Manager.php +++ b/module/VuFind/src/VuFind/Account/Manager.php @@ -128,7 +128,7 @@ class Manager } try { $catalog = VF_Connection_Manager::connectToCatalog(); - } catch (Exception $e) { + } catch (\Exception $e) { // If we can't connect to the catalog, assume that no special // ILS-related login settings exist -- this prevents ILS errors // from triggering an exception early in initialization before @@ -247,7 +247,7 @@ class Manager } catch (VF_Exception_Auth $e) { // Pass authentication exceptions through unmodified throw $e; - } catch (Exception $e) { + } catch (\Exception $e) { // Catch other exceptions and treat them as technical difficulties throw new VF_Exception_Auth('authentication_error_technical'); } diff --git a/module/VuFind/src/VuFind/Connection/Solr.php b/module/VuFind/src/VuFind/Connection/Solr.php index e83860d0511..7abd2400884 100644 --- a/module/VuFind/src/VuFind/Connection/Solr.php +++ b/module/VuFind/src/VuFind/Connection/Solr.php @@ -1695,7 +1695,7 @@ class Solr $info[$data['terms']['id'][$i]] = $data['terms']['id'][$i+1]; } return $info; - } catch(Exception $e) { + } catch(\Exception $e) { return $result; } } diff --git a/module/VuFind/src/VuFind/Search/Base/Results.php b/module/VuFind/src/VuFind/Search/Base/Results.php index 8927e556329..bc839e87772 100644 --- a/module/VuFind/src/VuFind/Search/Base/Results.php +++ b/module/VuFind/src/VuFind/Search/Base/Results.php @@ -174,7 +174,7 @@ abstract class Results foreach ($ids as $id) { try { $retVal[] = static::getRecord($id); - } catch (Exception $e) { + } catch (\Exception $e) { // Just omit missing records from the return array; calling code // in the VF_Record::loadBatch() method will deal with this. } diff --git a/module/VuFind/src/VuFind/Theme/Root/Helper/AuthorNotes.php b/module/VuFind/src/VuFind/Theme/Root/Helper/AuthorNotes.php index 7867a717345..92d2953b250 100644 --- a/module/VuFind/src/VuFind/Theme/Root/Helper/AuthorNotes.php +++ b/module/VuFind/src/VuFind/Theme/Root/Helper/AuthorNotes.php @@ -73,7 +73,7 @@ class VuFind_Theme_Root_Helper_AuthorNotes extends Zend_View_Helper_Abstract if (empty($results[$provider])) { unset($results[$provider]); } - } catch (Exception $e) { + } catch (\Exception $e) { // Ignore exceptions: unset($results[$provider]); } diff --git a/module/VuFind/src/VuFind/Theme/Root/Helper/Citation.php b/module/VuFind/src/VuFind/Theme/Root/Helper/Citation.php index a3a9dd8a80e..79396f565e8 100644 --- a/module/VuFind/src/VuFind/Theme/Root/Helper/Citation.php +++ b/module/VuFind/src/VuFind/Theme/Root/Helper/Citation.php @@ -685,7 +685,7 @@ class VuFind_Theme_Root_Helper_Citation extends Zend_View_Helper_Abstract return $converter->convertFromDisplayDate( 'Y', $this->details['pubDate'] ); - } catch (Exception $e) { + } catch (\Exception $e) { // Ignore date errors -- no point in dying here: return false; } diff --git a/module/VuFind/src/VuFind/Theme/Root/Helper/Excerpt.php b/module/VuFind/src/VuFind/Theme/Root/Helper/Excerpt.php index fa2f6c939cc..dc8f9fbd81d 100644 --- a/module/VuFind/src/VuFind/Theme/Root/Helper/Excerpt.php +++ b/module/VuFind/src/VuFind/Theme/Root/Helper/Excerpt.php @@ -73,7 +73,7 @@ class VuFind_Theme_Root_Helper_Excerpt extends Zend_View_Helper_Abstract if (empty($results[$provider])) { unset($results[$provider]); } - } catch (Exception $e) { + } catch (\Exception $e) { // Ignore exceptions: unset($results[$provider]); } diff --git a/module/VuFind/src/VuFind/Theme/Root/Helper/Reviews.php b/module/VuFind/src/VuFind/Theme/Root/Helper/Reviews.php index 6790567b893..0448c8b4d54 100644 --- a/module/VuFind/src/VuFind/Theme/Root/Helper/Reviews.php +++ b/module/VuFind/src/VuFind/Theme/Root/Helper/Reviews.php @@ -73,7 +73,7 @@ class VuFind_Theme_Root_Helper_Reviews extends Zend_View_Helper_Abstract if (empty($results[$provider])) { unset($results[$provider]); } - } catch (Exception $e) { + } catch (\Exception $e) { // Ignore exceptions: unset($results[$provider]); } @@ -218,7 +218,7 @@ class VuFind_Theme_Root_Helper_Reviews extends Zend_View_Helper_Abstract ? $this->config->Content->amazonassociate : null ); $data = $amazon->itemLookup($this->getIsbn10(), $params); - } catch (Exception $e) { + } catch (\Exception $e) { // Something went wrong? Just return empty list. return array(); } diff --git a/module/VuFind/src/VuFind/Theme/Root/Helper/VideoClips.php b/module/VuFind/src/VuFind/Theme/Root/Helper/VideoClips.php index 7cbd0f617d8..1ff5540652c 100644 --- a/module/VuFind/src/VuFind/Theme/Root/Helper/VideoClips.php +++ b/module/VuFind/src/VuFind/Theme/Root/Helper/VideoClips.php @@ -73,7 +73,7 @@ class VuFind_Theme_Root_Helper_VideoClips extends Zend_View_Helper_Abstract if (empty($results[$provider])) { unset($results[$provider]); } - } catch (Exception $e) { + } catch (\Exception $e) { // Ignore exceptions: unset($results[$provider]); } -- GitLab