Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 18 additions & 6 deletions control/app/components/settings/settings.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,23 @@ app.controller( "settingsController",
hud.dismiss();
uibHelper.headsupModal('Settings Changed', 'Name and or location successfully updated.');
} )
.catch( function ( err ) {
hud.dismiss();
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;
}

} )
} )
}
};

$scope.register = function () {
$log.debug( "Registering using code." );
Expand All @@ -32,10 +47,7 @@ app.controller( "settingsController",
} )
.catch( function ( err ) {
uibHelper.headsupModal( "Something Bad Happened!", "Could not register Ourglass system. Please try again!" );

} )
};

}


} );
} );