diff options
author | Bharat Mediratta <bharat@menalto.com> | 2010-07-21 11:43:51 -0700 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2010-07-21 11:43:51 -0700 |
commit | adeea49e0a4b4d68e389b0d286957d24a5e16bb6 (patch) | |
tree | 795dde112765f9b4a3039e114dcf3d052e2a9f3e /modules | |
parent | 2cf51983535ffa498c38b02328e30fe307ec6827 (diff) |
Catch any exceptions thrown when we try to restore the original
identity provider after we fail to set up a new one.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/gallery/libraries/IdentityProvider.php | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/modules/gallery/libraries/IdentityProvider.php b/modules/gallery/libraries/IdentityProvider.php index 067a9929..5f341c90 100644 --- a/modules/gallery/libraries/IdentityProvider.php +++ b/modules/gallery/libraries/IdentityProvider.php @@ -99,18 +99,24 @@ class IdentityProvider_Core { $restore_already_running = true; // Make sure new provider is not in the database - module::uninstall($new_provider); - - // Lets reset to the current provider so that the gallery installation is still - // working. - module::set_var("gallery", "identity_provider", null); - IdentityProvider::change_provider($current_provider); - module::activate($current_provider); + try { + module::uninstall($new_provider); + + // Lets reset to the current provider so that the gallery installation is still + // working. + module::set_var("gallery", "identity_provider", null); + IdentityProvider::change_provider($current_provider); + module::activate($current_provider); + } catch (Exception $e2) { + Kohana_Log::add("error", "Error restoring original identity provider\n" . + $e2->getMessage() . "\n" . $e2->getTraceAsString()); + } + message::error( t("Error attempting to enable \"%new_provider\" identity provider, " . "reverted to \"%old_provider\" identity provider", array("new_provider" => $new_provider, "old_provider" => $current_provider))); - + $restore_already_running = false; } throw $e; |