aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication
diff options
context:
space:
mode:
authorMirta <mirta@twine-s.com>2019-08-08 15:25:02 +0300
committerMirta <mirta@twine-s.com>2019-08-08 15:25:02 +0300
commitc7afd7e05b3230a4c652d74effd813b858da8ee3 (patch)
tree5e932dbdf668929ddc416b1706d5b481c2863ba2 /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication
parentb112abfecb622ac7fcb7c161b03f450fbb58b00a (diff)
parentd627576c770ddab1079940c34057a55206f6a835 (diff)
downloadTango-c7afd7e05b3230a4c652d74effd813b858da8ee3.tar.gz
Tango-c7afd7e05b3230a4c652d74effd813b858da8ee3.zip
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication')
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs26
1 files changed, 18 insertions, 8 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs
index 7aa9ae890..951a40870 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs
@@ -17,6 +17,7 @@ using Tango.MachineStudio.Common.StudioApplication;
using Tango.Core.Helpers;
using Tango.MachineStudio.Common.Web;
using Tango.BL.Builders;
+using System.Data.Entity.Core;
namespace Tango.MachineStudio.UI.Authentication
{
@@ -70,14 +71,24 @@ namespace Tango.MachineStudio.UI.Authentication
var settings = SettingsManager.Default.GetOrCreate<MachineStudioSettings>();
_client.Environment = settings.DeploymentSlot;
- var response = _client.Login(new LoginRequest()
+
+ LoginResponse response = null;
+
+ try
{
+ response = _client.Login(new LoginRequest()
+ {
- Email = email,
- Password = password,
- Version = AssemblyHelper.GetCurrentAssemblyVersion().ToString(),
+ Email = email,
+ Password = password,
+ Version = AssemblyHelper.GetCurrentAssemblyVersion().ToString(),
- }).Result;
+ }).Result;
+ }
+ catch (Exception ex)
+ {
+ throw new AggregateException(new AuthenticationException("Error logging in to machine service."), ex);
+ }
if (settings.Environment == MachineStudioSettings.WorkingEnvironment.Remote)
{
@@ -88,10 +99,9 @@ namespace Tango.MachineStudio.UI.Authentication
{
ObservablesStaticCollections.Instance.Initialize();
}
- catch (System.Data.Entity.Core.MetadataException)
+ catch (Exception ex)
{
- ObservablesContext.ClearModelStore();
- ObservablesStaticCollections.Instance.Initialize();
+ throw new AggregateException(new MetadataException("Error initializing database connection."), ex);
}
using (ObservablesContext db = ObservablesContext.CreateDefault())