MediaWiki
1.30.0
|
Exception used to abort API execution with an error. More...
Public Member Functions | |
__construct (ApiBase $module=null, StatusValue $status, $httpCode=0) | |
__toString () | |
getCodeString () | |
getMessageArray () | |
getMessageObject () | |
@inheritDoc More... | |
getModulePath () | |
Fetch the responsible module name. More... | |
getStatusValue () | |
Fetch the error status. More... | |
Public Member Functions inherited from UsageException | |
__construct ( $message, $codestr, $code=0, $extradata=null) | |
Public Member Functions inherited from MWException | |
getHTML () | |
If $wgShowExceptionDetails is true, return a HTML message with a backtrace to the error, otherwise show a message to ask to set it to true to show that information. More... | |
getPageTitle () | |
Return the title of the page when reporting this error in a HTTP response. More... | |
getText () | |
Get the text to display when reporting the error on the command line. More... | |
isLoggable () | |
Whether to log this exception in the exception debug log. More... | |
msg ( $key, $fallback) | |
Get a message from i18n. More... | |
report () | |
Output a report about the exception and takes care of formatting. More... | |
reportHTML () | |
Output the exception report using HTML. More... | |
useMessageCache () | |
Can the extension use the Message class/wfMessage to get i18n-ed messages? More... | |
useOutputPage () | |
Should the exception use $wgOut to output the error? More... | |
Static Public Member Functions | |
static | newWithMessage (ApiBase $module=null, $msg, $code=null, $data=null, $httpCode=0) |
Static Public Member Functions inherited from MWException | |
static | isCommandLine () |
Check whether we are in command line mode or not to report the exception in the correct format. More... | |
Protected Attributes | |
$modulePath | |
$status | |
Private Member Functions | |
getApiMessage () | |
Exception used to abort API execution with an error.
If possible, use ApiBase::dieWithError() instead of throwing this directly.
Definition at line 104 of file ApiUsageException.php.
ApiUsageException::__construct | ( | ApiBase | $module = null , |
StatusValue | $status, | ||
$httpCode = 0 |
|||
) |
ApiBase | null | $module | API module responsible for the error, if known |
StatusValue | $status | Status holding errors |
int | $httpCode | HTTP error code to use |
Definition at line 114 of file ApiUsageException.php.
References $status, getApiMessage(), and ApiErrorFormatter\stripMarkup().
ApiUsageException::__toString | ( | ) |
Reimplemented from UsageException.
Definition at line 222 of file ApiUsageException.php.
References getApiMessage(), and ApiErrorFormatter\stripMarkup().
|
private |
Definition at line 157 of file ApiUsageException.php.
References ApiMessage\create().
Referenced by __construct(), __toString(), getCodeString(), and getMessageArray().
ApiUsageException::getCodeString | ( | ) |
This only exists here because UsageException is in the inheritance chain for backwards compatibility. @inheritDoc
Reimplemented from UsageException.
Definition at line 191 of file ApiUsageException.php.
References getApiMessage(), and wfDeprecated().
ApiUsageException::getMessageArray | ( | ) |
This only exists here because UsageException is in the inheritance chain for backwards compatibility. @inheritDoc
Reimplemented from UsageException.
Definition at line 201 of file ApiUsageException.php.
References getApiMessage(), ApiErrorFormatter\stripMarkup(), and wfDeprecated().
ApiUsageException::getMessageObject | ( | ) |
ApiUsageException::getModulePath | ( | ) |
Fetch the responsible module name.
Definition at line 174 of file ApiUsageException.php.
References $modulePath.
ApiUsageException::getStatusValue | ( | ) |
Fetch the error status.
Definition at line 182 of file ApiUsageException.php.
References $status.
Referenced by ApiTestCase\apiExceptionHasCode(), ApiParamInfo\execute(), ApiMain\handleException(), ApiFormatPhpTest\testCrossDomainMangling(), and ApiParseTest\testParseNonexistentPage().
|
static |
ApiBase | null | $module | API module responsible for the error, if known |
string | array | Message | $msg | See ApiMessage::create() |
string | null | $code | See ApiMessage::create() |
array | null | $data | See ApiMessage::create() |
int | $httpCode | HTTP error code to use |
Definition at line 144 of file ApiUsageException.php.
References $code, ApiMessage\create(), and StatusValue\newFatal().
Referenced by ApiContinuationManager\__construct(), ApiBase\dieWithError(), WatchedItemQueryService\getWatchlistOwnerId(), and ApiBaseTest\provideGetParameterFromSettings().
|
protected |
Definition at line 106 of file ApiUsageException.php.
Referenced by getModulePath().
|
protected |
Definition at line 107 of file ApiUsageException.php.
Referenced by __construct(), and getStatusValue().