Aaron Schulz has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/185656

Change subject: Changed FileBackend exceptions to subclass Exception
......................................................................

Changed FileBackend exceptions to subclass Exception

Change-Id: Ic7d4d6cf0dde3e93ef78758b1a6b03f78c9bcdba
---
M includes/filebackend/FileBackend.php
M includes/filebackend/filejournal/FileJournal.php
M includes/filebackend/lockmanager/LockManagerGroup.php
M includes/filebackend/lockmanager/MemcLockManager.php
M includes/filebackend/lockmanager/RedisLockManager.php
5 files changed, 14 insertions(+), 14 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/56/185656/1

diff --git a/includes/filebackend/FileBackend.php 
b/includes/filebackend/FileBackend.php
index 8c0a61a..9504112 100644
--- a/includes/filebackend/FileBackend.php
+++ b/includes/filebackend/FileBackend.php
@@ -1491,7 +1491,7 @@
  * @ingroup FileBackend
  * @since 1.23
  */
-class FileBackendException extends MWException {
+class FileBackendException extends Exception {
 }
 
 /**
diff --git a/includes/filebackend/filejournal/FileJournal.php 
b/includes/filebackend/filejournal/FileJournal.php
index c065148..4ee5222 100644
--- a/includes/filebackend/filejournal/FileJournal.php
+++ b/includes/filebackend/filejournal/FileJournal.php
@@ -57,14 +57,14 @@
         *
         * @param array $config
         * @param string $backend A registered file backend name
-        * @throws MWException
+        * @throws Exception
         * @return FileJournal
         */
        final public static function factory( array $config, $backend ) {
                $class = $config['class'];
                $jrn = new $class( $config );
                if ( !$jrn instanceof self ) {
-                       throw new MWException( "Class given is not an instance 
of FileJournal." );
+                       throw new Exception( "Class given is not an instance of 
FileJournal." );
                }
                $jrn->backend = $backend;
 
diff --git a/includes/filebackend/lockmanager/LockManagerGroup.php 
b/includes/filebackend/lockmanager/LockManagerGroup.php
index 19fc4fe..c72863e 100644
--- a/includes/filebackend/lockmanager/LockManagerGroup.php
+++ b/includes/filebackend/lockmanager/LockManagerGroup.php
@@ -78,17 +78,17 @@
         * Register an array of file lock manager configurations
         *
         * @param array $configs
-        * @throws MWException
+        * @throws Exception
         */
        protected function register( array $configs ) {
                foreach ( $configs as $config ) {
                        $config['domain'] = $this->domain;
                        if ( !isset( $config['name'] ) ) {
-                               throw new MWException( "Cannot register a lock 
manager with no name." );
+                               throw new Exception( "Cannot register a lock 
manager with no name." );
                        }
                        $name = $config['name'];
                        if ( !isset( $config['class'] ) ) {
-                               throw new MWException( "Cannot register lock 
manager `{$name}` with no class." );
+                               throw new Exception( "Cannot register lock 
manager `{$name}` with no class." );
                        }
                        $class = $config['class'];
                        unset( $config['class'] ); // lock manager won't need 
this
@@ -105,11 +105,11 @@
         *
         * @param string $name
         * @return LockManager
-        * @throws MWException
+        * @throws Exception
         */
        public function get( $name ) {
                if ( !isset( $this->managers[$name] ) ) {
-                       throw new MWException( "No lock manager defined with 
the name `$name`." );
+                       throw new Exception( "No lock manager defined with the 
name `$name`." );
                }
                // Lazy-load the actual lock manager instance
                if ( !isset( $this->managers[$name]['instance'] ) ) {
@@ -126,11 +126,11 @@
         *
         * @param string $name
         * @return array
-        * @throws MWException
+        * @throws Exception
         */
        public function config( $name ) {
                if ( !isset( $this->managers[$name] ) ) {
-                       throw new MWException( "No lock manager defined with 
the name `$name`." );
+                       throw new Exception( "No lock manager defined with the 
name `$name`." );
                }
                $class = $this->managers[$name]['class'];
 
@@ -155,7 +155,7 @@
         * Throws an exception if no lock manager could be found.
         *
         * @return LockManager
-        * @throws MWException
+        * @throws Exception
         */
        public function getAny() {
                return isset( $this->managers['default'] )
diff --git a/includes/filebackend/lockmanager/MemcLockManager.php 
b/includes/filebackend/lockmanager/MemcLockManager.php
index 16d3de1..24d96e0 100644
--- a/includes/filebackend/lockmanager/MemcLockManager.php
+++ b/includes/filebackend/lockmanager/MemcLockManager.php
@@ -61,7 +61,7 @@
         *                    each having an odd-numbered list of server names 
(peers) as values.
         *   - memcConfig   : Configuration array for 
ObjectCache::newFromParams. [optional]
         *                    If set, this must use one of the memcached 
classes.
-        * @throws MWException
+        * @throws Exception
         */
        public function __construct( array $config ) {
                parent::__construct( $config );
@@ -80,7 +80,7 @@
                        if ( $cache instanceof MemcachedBagOStuff ) {
                                $this->bagOStuffs[$name] = $cache;
                        } else {
-                               throw new MWException(
+                               throw new Exception(
                                        'Only MemcachedBagOStuff classes are 
supported by MemcLockManager.' );
                        }
                }
diff --git a/includes/filebackend/lockmanager/RedisLockManager.php 
b/includes/filebackend/lockmanager/RedisLockManager.php
index 90e0581..90e62e6 100644
--- a/includes/filebackend/lockmanager/RedisLockManager.php
+++ b/includes/filebackend/lockmanager/RedisLockManager.php
@@ -62,7 +62,7 @@
         *   - srvsByBucket : Array of 1-16 consecutive integer keys, starting 
from 0,
         *                    each having an odd-numbered list of server names 
(peers) as values.
         *   - redisConfig  : Configuration for 
RedisConnectionPool::__construct().
-        * @throws MWException
+        * @throws Exception
         */
        public function __construct( array $config ) {
                parent::__construct( $config );

-- 
To view, visit https://gerrit.wikimedia.org/r/185656
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic7d4d6cf0dde3e93ef78758b1a6b03f78c9bcdba
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to