diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2005-09-30 21:12:36 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2005-09-30 21:12:36 +0800 |
commit | 3bd2067f26820ac1302301edf62ea04a71a7dc70 (patch) | |
tree | 7f11c1e1aa0ba9340a70f32cbcf28379e5ddad95 /embed/mozilla/EphyAboutModule.cpp | |
parent | 38b5b799c8b881efa7703bf3b64be6e7194f5327 (diff) | |
download | gsoc2013-epiphany-3bd2067f26820ac1302301edf62ea04a71a7dc70.tar gsoc2013-epiphany-3bd2067f26820ac1302301edf62ea04a71a7dc70.tar.gz gsoc2013-epiphany-3bd2067f26820ac1302301edf62ea04a71a7dc70.tar.bz2 gsoc2013-epiphany-3bd2067f26820ac1302301edf62ea04a71a7dc70.tar.lz gsoc2013-epiphany-3bd2067f26820ac1302301edf62ea04a71a7dc70.tar.xz gsoc2013-epiphany-3bd2067f26820ac1302301edf62ea04a71a7dc70.tar.zst gsoc2013-epiphany-3bd2067f26820ac1302301edf62ea04a71a7dc70.zip |
Return error on failure.
2005-09-26 Christian Persch <chpe@cvs.gnome.org>
* embed/mozilla/EphyAboutModule.cpp:
Return error on failure.
Diffstat (limited to 'embed/mozilla/EphyAboutModule.cpp')
-rw-r--r-- | embed/mozilla/EphyAboutModule.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/embed/mozilla/EphyAboutModule.cpp b/embed/mozilla/EphyAboutModule.cpp index b425216a7..c87d85d83 100644 --- a/embed/mozilla/EphyAboutModule.cpp +++ b/embed/mozilla/EphyAboutModule.cpp @@ -71,7 +71,7 @@ EphyAboutModule::NewChannel(nsIURI *aURI, nsCAutoString path; aURI->GetPath (path); - if (strncmp (path.get(), "neterror", strlen ("neterror")) == 0) + if (strncmp (path.get(), "neterror?", strlen ("neterror?")) == 0) { return CreateErrorPage (aURI, _retval); } @@ -163,7 +163,7 @@ EphyAboutModule::ParseErrorURL(const char *aURL, } g_strfreev (params); - + return NS_OK; } @@ -347,16 +347,17 @@ EphyAboutModule::CreateErrorPage(nsIURI *aErrorURI, nsresult rv = NS_ERROR_ILLEGAL_VALUE; nsCAutoString spec; rv = aErrorURI->GetSpec (spec); - NS_ENSURE_TRUE (NS_SUCCEEDED (rv) && !spec.IsEmpty(), rv); + NS_ENSURE_TRUE (NS_SUCCEEDED (rv), rv); nsCAutoString error, rawurl, url, charset; rv = ParseErrorURL (spec.get (), error, rawurl, url, charset); - if (NS_FAILED (rv) || error.IsEmpty () || url.IsEmpty()) return rv; + if (NS_FAILED (rv)) return rv; + if (error.IsEmpty () || rawurl.IsEmpty () || url.IsEmpty()) return NS_ERROR_FAILURE; nsCOMPtr<nsIURI> uri; rv = EphyUtils::NewURI(getter_AddRefs (uri), url, charset.get()); /* FIXME can uri be NULL if the original url was invalid? */ - NS_ENSURE_TRUE (NS_SUCCEEDED (rv) && uri, rv); + NS_ENSURE_TRUE (NS_SUCCEEDED (rv), rv); char *primary = nsnull, *secondary = nsnull, *tertiary = nsnull, *linkintro = nsnull; rv = GetErrorMessage (uri, error.get(), &primary, &secondary, &tertiary, &linkintro); @@ -376,7 +377,7 @@ EphyAboutModule::CreateErrorPage(nsIURI *aErrorURI, return Redirect (url, _retval); } - + NS_ENSURE_SUCCESS (rv, rv); NS_ENSURE_TRUE (primary && secondary, NS_ERROR_FAILURE); /* open the rendering stream */ |