From aadd559b1153524197e9a96af037979d8c6c2301 Mon Sep 17 00:00:00 2001 From: erikphillips Date: Tue, 21 Feb 2017 16:24:52 -0800 Subject: [PATCH 1/2] fixed issue with hud not dismissing on error with changing system name or location --- .../app/components/settings/settings.controller.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/control/app/components/settings/settings.controller.js b/control/app/components/settings/settings.controller.js index f883c53..efe6d5c 100644 --- a/control/app/components/settings/settings.controller.js +++ b/control/app/components/settings/settings.controller.js @@ -20,8 +20,12 @@ app.controller( "settingsController", hud.dismiss(); uibHelper.headsupModal('Settings Changed', 'Name and or location successfully updated.'); } ) + .catch( function ( err ) { + hud.dismiss(); + uibHelper.headsupModal('System Not Registered', 'This system is not registered with Ourglass. Please register this device and try again.'); + } ) } ) - } + }; $scope.register = function () { $log.debug( "Registering using code." ); @@ -32,10 +36,7 @@ app.controller( "settingsController", } ) .catch( function ( err ) { uibHelper.headsupModal( "Something Bad Happened!", "Could not register Ourglass system. Please try again!" ); - } ) + }; - } - - - } ); \ No newline at end of file + } ); From acec09a89023a3fca4ccbb2bd968b3d4f0934f8e Mon Sep 17 00:00:00 2001 From: erikphillips Date: Tue, 21 Feb 2017 18:09:34 -0800 Subject: [PATCH 2/2] fixed issue 55 by adding error messages and dismissing hud when error occurs --- .../app/components/settings/settings.controller.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/control/app/components/settings/settings.controller.js b/control/app/components/settings/settings.controller.js index efe6d5c..eac0d3e 100644 --- a/control/app/components/settings/settings.controller.js +++ b/control/app/components/settings/settings.controller.js @@ -22,7 +22,18 @@ app.controller( "settingsController", } ) .catch( function ( err ) { hud.dismiss(); - uibHelper.headsupModal('System Not Registered', 'This system is not registered with Ourglass. Please register this device and try again.'); + switch ( err.status ) { + case 406: + uibHelper.headsupModal('System Not Registered', 'This system is not registered with Ourglass. Please register this device and try again.'); + break; + case 500: + uibHelper.headsupModal('Internal Server Error', 'The server encountered an unexpected condition which prevented it from fulfilling the update request.'); + break; + default: + uibHelper.headsupModal('Error: Unable to connect', 'Unable to connect to the system. Please check wifi connection and try again.'); + break; + } + } ) } ) };