X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiFormatBase.php;h=d43259dd8da94ddb735bddabf7e52cd400e11ba2;hb=d0830af6ba44c6bb51496c6577df4615f6c1bb46;hp=3c924bc698b12966391ef683fe2a67c9db4ff3fe;hpb=8f12ae314af362c6f495188564618732f944538c;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiFormatBase.php b/includes/api/ApiFormatBase.php index 3c924bc698..d43259dd8d 100644 --- a/includes/api/ApiFormatBase.php +++ b/includes/api/ApiFormatBase.php @@ -120,6 +120,16 @@ abstract class ApiFormatBase extends ApiBase { return $this->mDisabled; } + /** + * Whether this formatter can handle printing API errors. If this returns + * false, then on API errors the default printer will be instantiated. + * @since 1.23 + * @return bool + */ + public function canPrintErrors() { + return true; + } + /** * Initialize the printer function and prepare the output headers, etc. * This method must be the first outputting method during execution. @@ -377,6 +387,15 @@ class ApiFormatFeedWrapper extends ApiFormatBase { return true; } + /** + * ChannelFeed doesn't give us a method to print errors in a friendly + * manner, so just punt errors to the default printer. + * @return false + */ + public function canPrintErrors() { + return false; + } + /** * This class expects the result data to be in a custom format set by self::setResult() * $result['_feed'] - an instance of one of the $wgFeedClasses classes