Commit 0e9976bf authored by Edward Jung's avatar Edward Jung Committed by Commit Bot

Show generic network error interstitial for 4xx / 5xx errors that do not

have any content

Currently only a small subset of 4xx and 5xx HTTP errors show a net error
interstitial when the server responds with no content. This CL adds 
generic messaging for the other cases.

Bug: 632778
Change-Id: If39bf0ba1c89ac5e2b5a27f5973e1accc25dc0fa
Reviewed-on: https://chromium-review.googlesource.com/685674Reviewed-by: default avatarMatt Menke <mmenke@chromium.org>
Commit-Queue: Edward Jung <edwardjung@chromium.org>
Cr-Commit-Position: refs/heads/master@{#505337}
parent 65bc9896
......@@ -388,6 +388,14 @@ const LocalizedErrorMap http_error_options[] = {
},
};
const LocalizedErrorMap generic_4xx_5xx_error = {
0,
IDS_ERRORPAGES_HEADING_PAGE_NOT_WORKING,
IDS_ERRORPAGES_SUMMARY_CONTACT_SITE_OWNER,
SUGGEST_NONE,
SHOW_BUTTON_RELOAD,
};
const LocalizedErrorMap dns_probe_error_options[] = {
{error_page::DNS_PROBE_POSSIBLE,
IDS_ERRORPAGES_HEADING_NOT_AVAILABLE,
......@@ -452,9 +460,12 @@ const LocalizedErrorMap* LookupErrorMap(const std::string& error_domain,
arraysize(net_error_options),
error_code);
} else if (error_domain == Error::kHttpErrorDomain) {
return FindErrorMapInArray(http_error_options,
arraysize(http_error_options),
error_code);
const LocalizedErrorMap* map = FindErrorMapInArray(
http_error_options, arraysize(http_error_options), error_code);
// Handle miscellaneous 400/500 errors.
return !map && error_code >= 400 && error_code < 600
? &generic_4xx_5xx_error
: map;
} else if (error_domain == Error::kDnsProbeErrorDomain) {
const LocalizedErrorMap* map =
FindErrorMapInArray(dns_probe_error_options,
......
......@@ -218,7 +218,9 @@
<message name="IDS_ERRORPAGES_HEADING_PAGE_NOT_WORKING" desc="Heading in the error page for HTTP 5xx errors, which are considered to be server side errors. Also used for bad responses.">
This page isn’t working
</message>
<message name="IDS_ERRORPAGES_SUMMARY_CONTACT_SITE_OWNER" desc="Generic suggestion for when the server returns a HTTP 4xx or 5xx error asking users to contact the site owner.">
If the problem continues, contact the site owner.
</message>
<message name="IDS_ERRORPAGES_SUMMARY_WEBSITE_CANNOT_HANDLE_REQUEST" desc="Summary in the error page when the server returns a 501 or 505.">
<ph name="HOST_NAME">&lt;strong jscontent="hostName"&gt;&lt;/strong&gt;<ex>www.whatever.com</ex></ph> is currently unable to handle this request.
</message>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment