From 35fb85ba0b70ee5b813203fede73356ab7aaedf9 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Thu, 25 Jun 2015 13:02:18 -0700 Subject: [PATCH] Replace some MWException usage in User Change-Id: I61dbd6223354530311c497ad0f45ed49a573d0cb --- includes/User.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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; } -- 2.20.1