From 3d11157294cc83c4e179ac2bec798c2cf5b34d6d Mon Sep 17 00:00:00 2001 From: Kunal Mehta Date: Fri, 14 Nov 2014 11:47:52 -0800 Subject: [PATCH] AutoloadGenerator: Don't throw MWExceptions The class won't have been autoloaded, so it can't be used. Change-Id: I54a9be600839c7bffe7debb8ee35ac46694390b4 --- includes/utils/AutoloadGenerator.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/utils/AutoloadGenerator.php b/includes/utils/AutoloadGenerator.php index bcd339337b..ee2c77ab27 100644 --- a/includes/utils/AutoloadGenerator.php +++ b/includes/utils/AutoloadGenerator.php @@ -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 ) -- 2.20.1