jenkins-bot has submitted this change and it was merged.

Change subject: Adding $message of caught WikitextException object to displayed 
error
......................................................................


Adding $message of caught WikitextException object to displayed error

This commit pulls the $message field of a caught WikitextException object
and forwards it via the dieUsage method call. The message is passed as the
"detail" entry of the error object, meaning it will not be displayed to
the user.

Bug: T69000
Change-Id: I87cb484896ed1ac5369bf8c11b315d5f53ac3e8a
---
M includes/api/ApiParsoidUtilsFlow.php
1 file changed, 2 insertions(+), 1 deletion(-)

Approvals:
  Mattflaschen: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/api/ApiParsoidUtilsFlow.php 
b/includes/api/ApiParsoidUtilsFlow.php
index 695adfa..0d13d8e 100644
--- a/includes/api/ApiParsoidUtilsFlow.php
+++ b/includes/api/ApiParsoidUtilsFlow.php
@@ -15,7 +15,8 @@
                        $content = Utils::convert( $params['from'], 
$params['to'], $params['content'], $page->getTitle() );
                } catch ( WikitextException $e ) {
                        $code = $e->getErrorCode();
-                       $this->dieUsage( $this->msg( $code 
)->inContentLanguage()->useDatabase( false )->plain(), $code );
+                       $this->dieUsage( $this->msg( $code 
)->inContentLanguage()->useDatabase( false )->plain(), $code,
+                               $e->getStatusCode(), array( 'detail' => 
$e->getMessage() ) );
                        return; // helps static analysis know execution does 
not continue past self::dieUsage
                }
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I87cb484896ed1ac5369bf8c11b315d5f53ac3e8a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Happy5214 <happy5...@gmail.com>
Gerrit-Reviewer: Legoktm <legoktm.wikipe...@gmail.com>
Gerrit-Reviewer: Mattflaschen <mflasc...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to