Fix use of the default error text when returning RV_CONTINUE from HandleLoadError (issue #161).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@156 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
parent
a99e32072e
commit
650cb1d41d
|
@ -696,17 +696,20 @@ void BrowserWebViewDelegate::didFailProvisionalLoad(
|
|||
}
|
||||
|
||||
std::string error_text;
|
||||
CefString errorStr;
|
||||
|
||||
CefRefPtr<CefHandler> handler = browser_->GetHandler();
|
||||
CefHandler::RetVal rv = RV_CONTINUE;
|
||||
if(handler.get()) {
|
||||
// give the handler an opportunity to generate a custom error message
|
||||
CefString errorStr;
|
||||
CefHandler::RetVal rv = handler->HandleLoadError(browser_,
|
||||
rv = handler->HandleLoadError(browser_,
|
||||
browser_->GetCefFrame(frame),
|
||||
static_cast<CefHandler::ErrorCode>(error.reason),
|
||||
std::string(failed_ds->request().url().spec().data()), errorStr);
|
||||
if(rv == RV_HANDLED && !errorStr.empty())
|
||||
error_text = errorStr;
|
||||
}
|
||||
|
||||
if(rv == RV_HANDLED && !errorStr.empty()) {
|
||||
error_text = errorStr;
|
||||
} else {
|
||||
error_text = StringPrintf("Error %d when loading url %s",
|
||||
error.reason, failed_ds->request().url().spec().data());
|
||||
|
|
Loading…
Reference in New Issue