ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/RomCheater/trunk/RomCheater.Core/IWebBrowserProvider.cs
(Generate patch)

Comparing trunk/RomCheater.Core/IWebBrowserProvider.cs (file contents):
Revision 697 by william, Mon Jun 17 12:03:50 2013 UTC vs.
Revision 698 by william, Mon Jun 17 12:19:13 2013 UTC

--- 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 @@ namespace RomCheater.Core
         {
             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 @@ namespace RomCheater.Core
                 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