From: Aaron Schulz Date: Thu, 25 Jun 2015 20:02:18 +0000 (-0700) Subject: Replace some MWException usage in User X-Git-Tag: 1.31.0-rc.0~10920^2 X-Git-Url: http://git.cyclocoop.org/%22.%24h.%22?a=commitdiff_plain;h=35fb85ba0b70ee5b813203fede73356ab7aaedf9;p=lhc%2Fweb%2Fwiklou.git Replace some MWException usage in User Change-Id: I61dbd6223354530311c497ad0f45ed49a573d0cb --- diff --git a/includes/User.php b/includes/User.php index 1ee8173b2f..f0614fe3e4 100644 --- a/includes/User.php +++ b/includes/User.php @@ -369,7 +369,8 @@ class User implements IDBAccessObject { Hooks::run( 'UserLoadAfterLoadFromSession', array( $this ) ); break; default: - throw new MWException( "Unrecognised value for User->mFrom: \"{$this->mFrom}\"" ); + throw new UnexpectedValueException( + "Unrecognised value for User->mFrom: \"{$this->mFrom}\"" ); } } @@ -943,7 +944,7 @@ class User implements IDBAccessObject { * - 'usable' Valid for batch processes and login * - 'creatable' Valid for batch processes, login and account creation * - * @throws MWException + * @throws InvalidArgumentException * @return bool|string */ public static function getCanonicalName( $name, $validate = 'valid' ) { @@ -990,7 +991,8 @@ class User implements IDBAccessObject { } break; default: - throw new MWException( 'Invalid parameter value for $validate in ' . __METHOD__ ); + throw new InvalidArgumentException( + 'Invalid parameter value for $validate in ' . __METHOD__ ); } return $name; }