Go to the documentation of this file.
42 throw new InvalidArgumentException( __METHOD__ .
' requires a fatal Status' );
45 $this->modulePath = $module ? $module->getModulePath() :
null;
51 $enMsg->inLanguage(
'en' )->useDatabase(
false );
64 ApiBase $module =
null, $msg, $code =
null, $data =
null, $httpCode = 0
77 $errors = $this->status->getErrorsByType(
'error' );
79 $errors = $this->status->getErrors();
82 $msg =
new ApiMessage(
'apierror-unknownerror-nocode',
'unknownerror' );
117 $enMsg->inLanguage(
'en' )->useDatabase(
false );
120 return get_class( $this ) .
": {$enMsg->getApiCode()}: {$text} "
121 .
"in {$this->getFile()}:{$this->getLine()}\n"
122 .
"Stack trace:\n{$this->getTraceAsString()}";
getStatusValue()
Fetch the error status.
Exception used to abort API execution with an error.
Generic operation result class Has warning/error list, boolean status and arbitrary value.
__construct(ApiBase $module=null, StatusValue $status, $httpCode=0)
static newFatal( $message,... $parameters)
Factory function for fatal errors.
getModulePath()
Fetch the responsible module name.
static newWithMessage(ApiBase $module=null, $msg, $code=null, $data=null, $httpCode=0)
This abstract class implements many basic API functions, and is the base of all API classes.
Extension of Message implementing IApiMessage.
static wrap( $sv)
Succinct helper method to wrap a StatusValue.
static create( $msg, $code=null, array $data=null)
Create an IApiMessage for the message.
Interface for MediaWiki-localized exceptions.
getMessageObject()
Return a Message object for this exception.Message