Add debugging help to VisualEditor

VE doesn't use the debug log at all, it seems.  This adds a single
wfDebugLog call so that the person using the debug log can see that it
actually does hit VE.

Also, returns better information for parsoid errors.

For example, without it, a parsoid misconfiguration of setInterwiki()
gives:

    Error loading data from server: parsoidserver-http-bad-status:
    500. Would you like to retry?

with it, you get something like the following:

    Error loading data from server: parsoidserver-http-bad-status:
    500: Page Fetch failure for "BADURL": Error: getaddrinfo
    ENOTFOUND. Would you like to retry?

or

    Error loading data from server: parsoidserver-http-bad-status:
    500: Page Fetch failure for "BADURL": 404. Would you like to
    retry?

Bug: 39057
Bug: 43147
Bug: 63149
Change-Id: I52db9fac42d7c0228b93ce3caec470fff98254f0
This commit is contained in:
Mark A. Hershberger 2014-09-01 22:54:42 -04:00 committed by Jforrester
parent d074da3558
commit 363b986879

View file

@ -83,7 +83,7 @@ class ApiVisualEditor extends ApiBase {
} else {
$message = 'MWHttpRequest error';
}
$this->dieUsage( $message, 'parsoidserver-' . $code );
$this->dieUsage( "$message: " . $req->getContent(), 'parsoidserver-' . $code );
}
// TODO pass through X-Parsoid-Performance header, merge with getHTML above
return $req->getContent();
@ -306,6 +306,7 @@ class ApiVisualEditor extends ApiBase {
$html = gzinflate( base64_decode( substr( $html, 11 ) ) );
}
wfDebugLog( 'visualeditor', "called on '$page' with paction: '{$params['paction']}'" );
switch ( $params['paction'] ) {
case 'parse':
$parsed = $this->getHTML( $page, $parserParams );