Go to the documentation of this file.
46 throw new InvalidArgumentException( __METHOD__ .
' requires a fatal Status' );
49 $this->modulePath = $module ? $module->
getModulePath() :
null;
55 $enMsg->inLanguage(
'en' )->useDatabase(
false );
69 ?
ApiBase $module, $msg, $code =
null, $data =
null, $httpCode = 0, Throwable $previous =
null
83 $errors = $this->status->getErrorsByType(
'error' );
85 $errors = $this->status->getErrors();
88 $msg =
new ApiMessage(
'apierror-unknownerror-nocode',
'unknownerror' );
123 $enMsg->inLanguage(
'en' )->useDatabase(
false );
126 return get_class( $this ) .
": {$enMsg->getApiCode()}: {$text} "
127 .
"in {$this->getFile()}:{$this->getLine()}\n"
128 .
"Stack trace:\n{$this->getTraceAsString()}"
129 . $this->getPrevious() ?
"\n\nNext {$this->getPrevious()}" :
"";
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.
static newFatal( $message,... $parameters)
Factory function for fatal errors.
static newWithMessage(?ApiBase $module, $msg, $code=null, $data=null, $httpCode=0, Throwable $previous=null)
getModulePath()
Fetch the responsible module name.
This abstract class implements many basic API functions, and is the base of all API classes.
Extension of Message implementing IApiMessage @newable.
static wrap( $sv)
Succinct helper method to wrap a StatusValue.
getModulePath()
Get the path to this module.
__construct(?ApiBase $module, StatusValue $status, $httpCode=0, Throwable $previous=null)
Stable to call.
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