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

# Line 54 | Line 54 | namespace RomCheater.Core
54          {
55              try
56              {
57 <                Uri uri = new Uri(url);
58 <                this.Provider.Navigate(uri);
57 >                try
58 >                {
59 >                    Uri uri = new Uri(url);
60 >                    this.Provider.Navigate(uri);
61 >                }
62 >                catch (UriFormatException)
63 >                {
64 >                    try
65 >                    {
66 >                        UriBuilder builder = new UriBuilder(url);
67 >                        var proto = builder.Uri.Scheme;
68 >                        this.Provider.Navigate(builder.Uri);
69 >                    }
70 >                    catch (Exception ex)
71 >                    {
72 >                        throw ex;
73 >                    }
74 >                }
75              }
76              catch (UriFormatException ex)
77              {
# Line 63 | Line 79 | namespace RomCheater.Core
79                  logger.Error.WriteLine("Unable to navigate to url: '{0}'", url);
80                  logger.VerboseError.WriteLine(ex.ToString());
81              }
82 +            catch (Exception ex)
83 +            {
84 +                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);
85 +                logger.Error.WriteLine("Unable to navigate to url: '{0}'", url);
86 +                logger.VerboseError.WriteLine(ex.ToString());
87 +            }
88          }
89  
90          #endregion

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines