Catch http status 500 in webview

My app has a webview for logging in over oAuth. Works ok, yet some servers return a 500 (internal server error). Any suggestions for catching these?

I was looking into <PageLoaded> but haven’t been able to detect all 500s. Some are a white page, some have a message. Is it possible to get the response.status a la fetch?

I had the same problem when experimenting with Fetch. The following code logs “Error: Internal Server Error...". oAuth should offer the same functionality.

.then(function(response) {
    if (!response.ok) {
        throw Error(response.statusText);
    return response;
}).then(function(response) {
}).catch(function(error) {

Thanks you for your answer, Enrico, but my question is about the <WebView> component, not using fetch.