for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Addwiki\Mediawiki\Api\Client;
use Exception;
/**
* Class representing a Mediawiki Api UsageException
*
* @since 0.1
* @author Addshore
*/
class UsageException extends Exception {
* @var string
private $apiCode;
* @var array
private $result = [];
private $rawMessage;
* @param string $apiCode The API error code.
* @param string $message The API error message.
* @param array $result the result the exception was generated from
public function __construct( $apiCode = '', $message = '', $result = [] ) {
$this->apiCode = $apiCode;
$this->result = $result;
$this->rawMessage = $message;
$message = 'Code: ' . $apiCode . PHP_EOL .
'Message: ' . $message . PHP_EOL .
'Result: ' . json_encode( $result );
parent::__construct( $message, 0, null );
}
* @return string
public function getApiCode() {
return $this->apiCode;
* @since 0.3
* @return array
public function getApiResult() {
return $this->result;
* @since 2.3.0
public function getRawMessage() {
return $this->rawMessage;