* @param string $errorCode Brief, arbitrary, stable string to allow easy
* automated identification of the error, e.g., 'unknown_action'
* @param int $httpRespCode HTTP response code
- * @param array $extradata Data to add to the "<error>" element; array in ApiResult format
- * @throws UsageException
+ * @param array|null $extradata Data to add to the "<error>" element; array in ApiResult format
+ * @throws UsageException always
*/
public function dieUsage( $description, $errorCode, $httpRespCode = 0, $extradata = null ) {
throw new UsageException(
*
* @since 1.22
* @param Status $status
- * @throws MWException
+ * @throws UsageException always
*/
public function dieStatus( $status ) {
-
list( $code, $msg ) = $this->getErrorFromStatus( $status );
$this->dieUsage( $msg, $code );
}
/**
* Helper function for readonly errors
+ *
+ * @throws UsageException always
*/
public function dieReadOnly() {
$parsed = $this->parseMsg( array( 'readonlytext' ) );
/**
* Output the error message related to a certain array
* @param array|string $error Element of a getUserPermissionsErrors()-style array
+ * @throws UsageException always
*/
public function dieUsageMsg( $error ) {
# most of the time we send a 1 element, so we might as well send it as
* Will only set a warning instead of failing if the global $wgDebugAPI
* is set to true. Otherwise behaves exactly as dieUsageMsg().
* @param array|string $error Element of a getUserPermissionsErrors()-style array
+ * @throws UsageException
* @since 1.21
*/
public function dieUsageMsgOrDebug( $error ) {
* Die with the $prefix.'badcontinue' error. This call is common enough to
* make it into the base method.
* @param bool $condition Will only die if this value is true
+ * @throws UsageException
* @since 1.21
*/
protected function dieContinueUsageIf( $condition ) {
* Internal code errors should be reported with this method
* @param string $method Method or function name
* @param string $message Error message
- * @throws MWException
+ * @throws MWException always
*/
protected static function dieDebug( $method, $message ) {
throw new MWException( "Internal error in $method: $message" );