BlueSpice MediaWiki master
 All Classes Namespaces Files Functions Variables Groups Pages
ApiUsageException Class Reference
Inheritance diagram for ApiUsageException:
Collaboration diagram for ApiUsageException:

Public Member Functions

 __construct (ApiBase $module=null, StatusValue $status, $httpCode=0)
 
 getModulePath ()
 
 getStatusValue ()
 
 getCodeString ()
 
 getMessageArray ()
 
 getMessageObject ()
 
 __toString ()
 
- Public Member Functions inherited from UsageException
 __construct ($message, $codestr, $code=0, $extradata=null)
 
 getCodeString ()
 
 getMessageArray ()
 
 __toString ()
 
- Public Member Functions inherited from MWException
 useOutputPage ()
 
 isLoggable ()
 
 useMessageCache ()
 
 msg ($key, $fallback)
 
 getHTML ()
 
 getText ()
 
 getPageTitle ()
 
 reportHTML ()
 
 report ()
 
- Public Member Functions inherited from Exception
 __construct ($message="", $code=0, Throwable $previous=null)
 
 getMessage ()
 
 getCode ()
 
 getFile ()
 
 getLine ()
 
 getTrace ()
 
 getPrevious ()
 
 getTraceAsString ()
 
 __toString ()
 

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 ()
 

Protected Attributes

 $modulePath
 
 $status
 
- Protected Attributes inherited from Exception
 $message
 
 $code
 
 $file
 
 $line
 

Detailed Description

Exception used to abort API execution with an error

If possible, use ApiBase::dieWithError() instead of throwing this directly.

Note
This currently extends UsageException for backwards compatibility, so all the existing code that catches UsageException won't break when stuff starts throwing ApiUsageException. Eventually UsageException will go away and this will (probably) extend MWException directly.

Constructor & Destructor Documentation

ApiUsageException::__construct ( ApiBase  $module = null,
StatusValue  $status,
  $httpCode = 0 
)
Parameters
ApiBase | null$moduleAPI module responsible for the error, if known
StatusValue$statusStatus holding errors
int$httpCodeHTTP error code to use

Member Function Documentation

ApiUsageException::__toString ( )
Returns
string

Implements Throwable.

ApiUsageException::getCodeString ( )
Deprecated:
Do not use. This only exists here because UsageException is in the inheritance chain for backwards compatibility.
ApiUsageException::getMessageArray ( )
Deprecated:
Do not use. This only exists here because UsageException is in the inheritance chain for backwards compatibility.
ApiUsageException::getMessageObject ( )

Implements ILocalizedException.

ApiUsageException::getModulePath ( )

Fetch the responsible module name

Returns
string|null
ApiUsageException::getStatusValue ( )

Fetch the error status

Returns
StatusValue
static ApiUsageException::newWithMessage ( ApiBase  $module = null,
  $msg,
  $code = null,
  $data = null,
  $httpCode = 0 
)
static
Parameters
ApiBase | null$moduleAPI module responsible for the error, if known
string | array | Message$msgSee ApiMessage::create()
string | null$codeSee ApiMessage::create()
array | null$dataSee ApiMessage::create()
int$httpCodeHTTP error code to use
Returns
static

The documentation for this class was generated from the following file: