Matthias Mullie has uploaded a new change for review.

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


Change subject: Make error reporting more verbose.
......................................................................

Make error reporting more verbose.

Based on $wgShowExceptionDetails, MWException outputs a stack trace. Our own
implementation omitted this.

It should now still add our own (more user-friendly) error message, but also
call MWException's getHTML, which may output a stack trace too.

Change-Id: Iceb03ea22080903cd4f9897a9bf77428a6100c8e
---
M includes/Exception/ExceptionHandling.php
1 file changed, 13 insertions(+), 2 deletions(-)


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

diff --git a/includes/Exception/ExceptionHandling.php 
b/includes/Exception/ExceptionHandling.php
index af9759b..581411b 100644
--- a/includes/Exception/ExceptionHandling.php
+++ b/includes/Exception/ExceptionHandling.php
@@ -61,13 +61,24 @@
        }
 
        /**
+        * Overrides MWException getHTML, adding a more human-friendly error 
message
+        *
+        * @return string
+        */
+       public function getHTML() {
+               $this->output->showErrorPage( 'errorpagetitle', 
$this->getErrorCode() );
+
+               return parent::getHTML();
+       }
+
+       /**
         * Exception from API/commandline will be handled by 
MWException::report(),
         * Overwrite the HTML display only
         */
        public function reportHTML() {
                $this->output->setStatusCode( $this->getStatusCode() );
-               $this->output->showErrorPage( 'errorpagetitle', 
$this->getErrorCode() );
-               $this->output->output();
+
+               parent::reportHTML();
        }
 
        /**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iceb03ea22080903cd4f9897a9bf77428a6100c8e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Matthias Mullie <mmul...@wikimedia.org>

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

Reply via email to