WebView not calling onReceivedError 500 error from server

Showing 1-2 of 2 messages
WebView not calling onReceivedError 500 error from server Brad 6/9/11 10:13 PM
I've got a webview and I've set the webviewclient to my own class
where I override the onReceivedError and onPageFinished methods.

When my server returns a 500 error code along with an html error
message, onPageFinished gets called but onReceviedError does not.

I've tried calling a completely bogus url and onReceivedError does get
called in this case (with "unable to resolve host" error code).

I wouldn't think it would matter but I'm making an https (SSL) call.

Am I mistaken in believing that onReceivedError should get called when
my server returns 500?

I could work around this by searching the returned html for a
commented keyword (that I insert in the server code), but alas there
is no way to access the html of the currently displayed page using
webview.

Basically I want to hide the webview control unless I'm certain that
it's displaying the content that I intend (from my server).
Re: WebView not calling onReceivedError 500 error from server Grantland 6/10/11 12:05 PM
onReceivedError doesn't get called on HTTP response errors, only
resource errors.

"... [onRecievedError] errors are not HTTP errors but are
unrecoverable resource errors (file not found, no network connection,
server not found for the main resource,
etc.)."

http://code.google.com/p/android/issues/detail?id=968