/[RomCheater]/trunk/RomCheater.Core/IWebBrowserProvider.cs
ViewVC logotype

Diff of /trunk/RomCheater.Core/IWebBrowserProvider.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- trunk/RomCheater.Core/IWebBrowserProvider.cs	2013/06/17 12:03:50	697
+++ trunk/RomCheater.Core/IWebBrowserProvider.cs	2013/06/17 12:19:13	698
@@ -54,8 +54,24 @@
         {
             try
             {
-                Uri uri = new Uri(url);
-                this.Provider.Navigate(uri);
+                try
+                {
+                    Uri uri = new Uri(url);
+                    this.Provider.Navigate(uri);
+                }
+                catch (UriFormatException)
+                {
+                    try
+                    {
+                        UriBuilder builder = new UriBuilder(url);
+                        var proto = builder.Uri.Scheme;
+                        this.Provider.Navigate(builder.Uri);
+                    }
+                    catch (Exception ex)
+                    {
+                        throw ex;
+                    }
+                }
             }
             catch (UriFormatException ex)
             {
@@ -63,6 +79,12 @@
                 logger.Error.WriteLine("Unable to navigate to url: '{0}'", url);
                 logger.VerboseError.WriteLine(ex.ToString());
             }
+            catch (Exception ex)
+            {
+                MessageBox.Show(string.Format("Could not navigate to url: '{0}'", url), string.Format("An {0} Exception Occurred in '{1}'",ex.GetType().Name, this.GetType().Name), MessageBoxButtons.OK, MessageBoxIcon.Error);
+                logger.Error.WriteLine("Unable to navigate to url: '{0}'", url);
+                logger.VerboseError.WriteLine(ex.ToString());
+            }
         }
 
         #endregion

 

  ViewVC Help
Powered by ViewVC 1.1.22