|
MediaWiki master
|
Exception used to abort API execution with an error. More...
Inherits MediaWiki\Exception\MWException, Stringable, and MediaWiki\Exception\ILocalizedException.

Public Member Functions | |
| __construct (?ApiBase $module, StatusValue $status, $httpCode=0, ?Throwable $previous=null) | |
| __toString () | |
| getMessageObject () | |
Return a Message object for this exception.
| |
| getModulePath () | |
| Fetch the responsible module name. | |
| getStatusValue () | |
| Fetch the error status. | |
Public Member Functions inherited from MediaWiki\Exception\MWException | |
| hasOverriddenHandler () | |
| isLoggable () | |
| Whether to log this exception in the exception debug log. | |
| msg ( $key, $fallback,... $params) | |
| Get a message from i18n. | |
| report () | |
| Output a report about the exception and takes care of formatting. | |
| useMessageCache () | |
| Can the extension use the Message class/wfMessage to get i18n-ed messages? | |
Static Public Member Functions | |
| static | newWithMessage (?ApiBase $module, $msg, $code=null, $data=null, $httpCode=0, ?Throwable $previous=null) |
Static Public Member Functions inherited from MediaWiki\Exception\MWException | |
| static | isCommandLine () |
| Check whether we are in command line mode or not to report the exception in the correct format. | |
Protected Attributes | |
| string null | $modulePath |
| StatusValue | $status |
Exception used to abort API execution with an error.
If possible, use ApiBase::dieWithError() instead of throwing this directly.
Definition at line 26 of file ApiUsageException.php.
| MediaWiki\Api\ApiUsageException::__construct | ( | ?ApiBase | $module, |
| StatusValue | $status, | ||
| $httpCode = 0, | |||
| ?Throwable | $previous = null ) |
| ApiBase | null | $module | API module responsible for the error, if known |
| StatusValue | $status | Status holding errors |
| int | $httpCode | HTTP error code to use |
| Throwable | null | $previous | Previous exception |
Definition at line 40 of file ApiUsageException.php.
References MediaWiki\Api\ApiUsageException\$status, MediaWiki\Api\ApiBase\getModulePath(), StatusValue\isOK(), and MediaWiki\Api\ApiErrorFormatter\stripMarkup().
| MediaWiki\Api\ApiUsageException::__toString | ( | ) |
Definition at line 118 of file ApiUsageException.php.
References MediaWiki\Api\ApiErrorFormatter\stripMarkup().
| MediaWiki\Api\ApiUsageException::getMessageObject | ( | ) |
Return a Message object for this exception.
Implements MediaWiki\Exception\ILocalizedException.
Definition at line 111 of file ApiUsageException.php.
| MediaWiki\Api\ApiUsageException::getModulePath | ( | ) |
Fetch the responsible module name.
Definition at line 96 of file ApiUsageException.php.
| MediaWiki\Api\ApiUsageException::getStatusValue | ( | ) |
Fetch the error status.
Definition at line 104 of file ApiUsageException.php.
Referenced by MediaWiki\Api\ApiParamInfo\execute(), MediaWiki\Rest\Handler\ActionModuleBasedHandler\execute(), and MediaWiki\Api\ApiMain\handleException().
|
static |
| ApiBase | null | $module | API module responsible for the error, if known |
| string | array | MessageSpecifier | $msg | See ApiMessage::create() |
| string | null | $code | See ApiMessage::create() |
| array | null | $data | See ApiMessage::create() |
| int | $httpCode | HTTP error code to use |
| Throwable | null | $previous | Previous exception |
Definition at line 65 of file ApiUsageException.php.
Referenced by MediaWiki\Api\ApiContinuationManager\__construct().
|
protected |
Definition at line 29 of file ApiUsageException.php.
|
protected |
Definition at line 31 of file ApiUsageException.php.
Referenced by MediaWiki\Api\ApiUsageException\__construct().