EBernhardson has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/125939

Change subject: Log more information about request failure
......................................................................

Log more information about request failure

Change-Id: I35eb5129b27380a9ca97c5e4bce61c4b7fda2375
---
M includes/Parsoid/Utils.php
1 file changed, 8 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow 
refs/changes/39/125939/1

diff --git a/includes/Parsoid/Utils.php b/includes/Parsoid/Utils.php
index c4c6f06..3bc7a95 100644
--- a/includes/Parsoid/Utils.php
+++ b/includes/Parsoid/Utils.php
@@ -62,18 +62,22 @@
                        throw new WikitextException( 'Unknown source format: ' 
. $from, 'process-wikitext' );
                }
 
-               $response = \Http::post(
+               $request = \MWHttpRequest::factory(
                        $parsoidURL . '/' . $parsoidPrefix . '/' . 
$title->getPrefixedDBkey(),
                        array(
+                               'method' => 'POST',
                                'postData' => wfArrayToCgi( array( $from => 
$content ) ),
                                'body' => true,
-                               'timeout' => $parsoidTimeout
+                               'timeout' => $parsoidTimeout,
+                               'connectTimeout' => 'default',
                        )
                );
-
-               if ( $response === false ) {
+               $status = $request->execute();
+               if ( !$status->isOK() ) {
+                       wfDebugLog( 'Flow', 'Failed contacting parsoid: ' . 
$status->getMessage()->text() );
                        throw new WikitextException( 'Failed contacting 
Parsoid', 'process-wikitext' );
                }
+               $response = $request->getContent();
 
                // HTML is wrapped in <body> tag, undo that.
                // unless $response is empty

-- 
To view, visit https://gerrit.wikimedia.org/r/125939
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I35eb5129b27380a9ca97c5e4bce61c4b7fda2375
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: EBernhardson <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to