Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 681F6200CBB for ; Tue, 4 Jul 2017 23:56:48 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 617B3161FE6; Tue, 4 Jul 2017 21:56:48 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id A6EA1161FE5 for ; Tue, 4 Jul 2017 23:56:47 +0200 (CEST) Received: (qmail 21156 invoked by uid 500); 4 Jul 2017 21:56:46 -0000 Mailing-List: contact commits-help@airavata.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@airavata.apache.org Delivered-To: mailing list commits@airavata.apache.org Received: (qmail 21146 invoked by uid 99); 4 Jul 2017 21:56:46 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Jul 2017 21:56:46 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id BA573DFE22; Tue, 4 Jul 2017 21:56:45 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: machristie@apache.org To: commits@airavata.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: airavata-php-gateway git commit: AIRAVATA-2478 Fix error handling when email can't be updated Date: Tue, 4 Jul 2017 21:56:45 +0000 (UTC) archived-at: Tue, 04 Jul 2017 21:56:48 -0000 Repository: airavata-php-gateway Updated Branches: refs/heads/develop 5d992bb5b -> 7802782a1 AIRAVATA-2478 Fix error handling when email can't be updated Project: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/repo Commit: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/commit/7802782a Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/7802782a Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/7802782a Branch: refs/heads/develop Commit: 7802782a1f90aad7b9a1ca789d0e3634d32c2896 Parents: 5d992bb Author: Marcus Christie Authored: Tue Jul 4 17:55:33 2017 -0400 Committer: Marcus Christie Committed: Tue Jul 4 17:55:33 2017 -0400 ---------------------------------------------------------------------- app/controllers/UserSettingsController.php | 13 +++++++++++-- app/views/account/user-profile-update-email.blade.php | 4 ++-- 2 files changed, 13 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/7802782a/app/controllers/UserSettingsController.php ---------------------------------------------------------------------- diff --git a/app/controllers/UserSettingsController.php b/app/controllers/UserSettingsController.php index 959c5dc..d73e874 100644 --- a/app/controllers/UserSettingsController.php +++ b/app/controllers/UserSettingsController.php @@ -220,7 +220,14 @@ class UserSettingsController extends BaseController } public function showUpdateEmailView() { - $userProfile = UserProfileUtilities::get_user_profile(Session::get("username")); + try { + $userProfile = UserProfileUtilities::get_user_profile(Session::get("username")); + } catch (Exception $e) { + Log::error("Failed to retrieve user profile. Error: " . $e->getMessage()); + return View::make("account/user-profile-update-email", array( + "email" => null + )); + } return View::make("account/user-profile-update-email", array( "email" => $userProfile->emails[0] )); @@ -272,8 +279,10 @@ class UserSettingsController extends BaseController "errorMessage", "Failed to update email address, please try again. Reason: confirmation link was not verified successfully."); } } catch (Exception $e) { + Log::error("Failed to update email address", array(Input::all())); + Log::error($e); return Redirect::to("account/user-profile-update-email")->with( - "errorMessage", "Failed to update email address, please try again. Reason: " . $e->message); + "errorMessage", "Failed to update email address, please try again. Reason: " . $e->getMessage()); } } } http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/7802782a/app/views/account/user-profile-update-email.blade.php ---------------------------------------------------------------------- diff --git a/app/views/account/user-profile-update-email.blade.php b/app/views/account/user-profile-update-email.blade.php index ea05bfb..11454f2 100644 --- a/app/views/account/user-profile-update-email.blade.php +++ b/app/views/account/user-profile-update-email.blade.php @@ -22,9 +22,9 @@ @endif - @if( isset($errorMessage) ) + @if( Session::has("errorMessage") ) @endif