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 B3BCC2004A1 for ; Wed, 9 Aug 2017 16:50:04 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id B24E11694EC; Wed, 9 Aug 2017 14:50:04 +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 428711694C9 for ; Wed, 9 Aug 2017 16:50:03 +0200 (CEST) Received: (qmail 48745 invoked by uid 500); 9 Aug 2017 14:50:02 -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 48671 invoked by uid 99); 9 Aug 2017 14:50:02 -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; Wed, 09 Aug 2017 14:50:02 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 06DF9F5556; Wed, 9 Aug 2017 14:50:01 +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 Date: Wed, 09 Aug 2017 14:50:14 -0000 Message-Id: <1d6d3046305942ef8e01a383b1f11922@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [15/50] airavata-php-gateway git commit: AIRAVATA-2478 Fix error handling when email can't be updated archived-at: Wed, 09 Aug 2017 14:50:04 -0000 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/dreg-gateway 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