@@ -15,9 +15,11 @@ public partial class ViewController : UIViewController
1515
1616 private const string ErrorTitle = "Error" ;
1717
18- private const string InvalidUriTitle = "Server URL is invalid" ;
18+ private const string InvalidUriTitle = "Server URL is invalid. " ;
1919
20- private const string InvalidUriMessage = "Input valid server URL" ;
20+ private const string EmptyUriMessage = "Provide WebDAV server URL." ;
21+
22+ private const string IncorrectServerNameMessage = "Incorrect server name." ;
2123
2224 /// <inheritdoc />
2325 protected ViewController ( IntPtr handle ) : base ( handle )
@@ -50,7 +52,8 @@ async partial void Login_Clicked(UIButton sender)
5052
5153 if ( string . IsNullOrEmpty ( serverUri ) || string . IsNullOrWhiteSpace ( serverUri ) )
5254 {
53- this . ShowAlert ( InvalidUriTitle , InvalidUriMessage ) ;
55+ this . ShowAlert ( InvalidUriTitle , EmptyUriMessage ) ;
56+ return ;
5457 }
5558
5659
@@ -66,14 +69,25 @@ async partial void Login_Clicked(UIButton sender)
6669 AppGroupSettings . SaveServerSettings ( serverSettings ) ;
6770 this . ShowAlert ( LoginSuccessfulTitle , LoginSuccessfulMessage ) ;
6871 }
72+ catch ( System . Net . WebException ex )
73+ {
74+ if ( ex . Status == System . Net . WebExceptionStatus . NameResolutionFailure )
75+ {
76+ this . ShowAlert ( InvalidUriTitle , IncorrectServerNameMessage ) ;
77+ }
78+ else
79+ {
80+ this . ShowAlert ( ErrorTitle , ex . Message ) ;
81+ }
82+ }
6983 catch ( Exception ex )
7084 {
7185 this . ShowAlert ( ErrorTitle , ex . Message ) ;
7286 }
7387 finally
7488 {
7589 sender . Enabled = true ;
76- }
90+ }
7791
7892 this . Editing = false ;
7993 this . Server . ResignFirstResponder ( ) ;
0 commit comments