diff options
| author | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2019-07-28 13:24:28 +0300 |
|---|---|---|
| committer | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2019-07-28 13:24:28 +0300 |
| commit | 230ea9b597a2932f5d16572d94ee14c862d5b419 (patch) | |
| tree | 7e260db879dd815f5350e11a4a85ca04514237b7 /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs | |
| parent | 16cc209e80498a0b39c1ad57d4f36be906cbb313 (diff) | |
| parent | 30759321e22e22363eda9387e178b4d48b7d9088 (diff) | |
| download | Tango-230ea9b597a2932f5d16572d94ee14c862d5b419.tar.gz Tango-230ea9b597a2932f5d16572d94ee14c862d5b419.zip | |
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs')
| -rw-r--r-- | Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs | 26 |
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()) |
