improve connect error messages

pull/702/head
Luke Pulverenti 9 years ago
parent 4f8764ee5a
commit 3d1c950de8

@ -24,6 +24,7 @@ using System.Text;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using CommonIO; using CommonIO;
using MediaBrowser.Common.Extensions;
namespace MediaBrowser.Server.Implementations.Connect namespace MediaBrowser.Server.Implementations.Connect
{ {
@ -555,9 +556,22 @@ namespace MediaBrowser.Server.Implementations.Connect
} }
catch (HttpException ex) catch (HttpException ex)
{ {
if (!ex.StatusCode.HasValue || if (!ex.StatusCode.HasValue)
ex.StatusCode.Value != HttpStatusCode.NotFound || {
!Validator.EmailIsValid(connectUsername)) throw;
}
// If they entered a username, then whatever the error is just throw it, for example, user not found
if (!Validator.EmailIsValid(connectUsername))
{
if (ex.StatusCode.Value == HttpStatusCode.NotFound)
{
throw new ResourceNotFoundException();
}
throw;
}
if (ex.StatusCode.Value != HttpStatusCode.NotFound)
{ {
throw; throw;
} }

@ -1688,9 +1688,6 @@
<Content Include="dashboard-ui\strings\ru.json"> <Content Include="dashboard-ui\strings\ru.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="dashboard-ui\strings\server.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="dashboard-ui\strings\sl-SI.json"> <Content Include="dashboard-ui\strings\sl-SI.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>

Loading…
Cancel
Save