Jsahleen has uploaded a new change for review.

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

Change subject: Publishing: Improve logging of publishing failures
......................................................................

Publishing: Improve logging of publishing failures

* Passes whole content of error to client on parsoid failure

* Adds publishing information and error to logging call

Change-Id: If56c8e12e6c1fa9b0dc162d1fb4b75d4e1e4a7f4
---
M api/ApiContentTranslationPublish.php
M modules/publish/ext.cx.publish.js
2 files changed, 11 insertions(+), 2 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ContentTranslation 
refs/changes/65/163565/1

diff --git a/api/ApiContentTranslationPublish.php 
b/api/ApiContentTranslationPublish.php
index a9af054..25b2435 100644
--- a/api/ApiContentTranslationPublish.php
+++ b/api/ApiContentTranslationPublish.php
@@ -38,7 +38,7 @@
 
                $status = $req->execute();
                if ( !$status->isOK() ) {
-                       throw new MWException( $status->getMessage()->text() );
+                       throw new MWException( $req->getContent() );
                }
 
                return $req->getContent();
diff --git a/modules/publish/ext.cx.publish.js 
b/modules/publish/ext.cx.publish.js
index d5a3661..ee020fd 100644
--- a/modules/publish/ext.cx.publish.js
+++ b/modules/publish/ext.cx.publish.js
@@ -141,8 +141,17 @@
                                mw.cx.targetLanguage
                        );
                } ).fail( function ( code, details ) {
+                       var trace = {
+                               from: mw.cx.sourceLanguage,
+                               to: mw.cx.targetLanguage,
+                               sourcetitle: mw.cx.sourceTitle,
+                               sourcerevision: mw.cx.sourceRevision,
+                               targetTitle: targetTitle,
+                               errorCode: code,
+                               errorDetails: details
+                       };
                        mw.hook( 'mw.cx.error' ).fire( mw.msg( 
'cx-publish-page-error' ) );
-                       mw.log( '[CX] Error while publishing:', code, details );
+                       mw.log( '[CX] Error while publishing:', code, trace );
                } ).always( function () {
                        $publishButton
                                .prop( 'disabled', false )

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If56c8e12e6c1fa9b0dc162d1fb4b75d4e1e4a7f4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Jsahleen <jsahl...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to