AutoloadGenerator: Don't throw MWExceptions
authorKunal Mehta <legoktm@gmail.com>
Fri, 14 Nov 2014 19:47:52 +0000 (11:47 -0800)
committerKunal Mehta <legoktm@gmail.com>
Fri, 14 Nov 2014 19:47:52 +0000 (11:47 -0800)
The class won't have been autoloaded, so it can't be used.

Change-Id: I54a9be600839c7bffe7debb8ee35ac46694390b4

includes/utils/AutoloadGenerator.php

index bcd3393..ee2c77a 100644 (file)
@@ -67,11 +67,11 @@ class AutoloadGenerator {
        public function forceClassPath( $fqcn, $inputPath ) {
                $path = realpath( $inputPath );
                if ( !$path ) {
-                       throw new \MWException( "Invalid path: $inputPath" );
+                       throw new \Exception( "Invalid path: $inputPath" );
                }
                $len = strlen( $this->basepath );
                if ( substr( $path, 0, $len ) !== $this->basepath ) {
-                       throw new \MWException( "Path is not within basepath: $inputPath" );
+                       throw new \Exception( "Path is not within basepath: $inputPath" );
                }
                $shortpath = substr( $path, $len );
                $this->overrides[$fqcn] = $shortpath;
@@ -83,11 +83,11 @@ class AutoloadGenerator {
        public function readFile( $inputPath ) {
                $path = realpath( $inputPath );
                if ( !$path ) {
-                       throw new \MWException( "Invalid path: $inputPath" );
+                       throw new \Exception( "Invalid path: $inputPath" );
                }
                $len = strlen( $this->basepath );
                if ( substr( $path, 0, $len ) !== $this->basepath ) {
-                       throw new \MWException( "Path is not within basepath: $inputPath" );
+                       throw new \Exception( "Path is not within basepath: $inputPath" );
                }
                $result = $this->collector->getClasses(
                        file_get_contents( $path )