Index: trunk/tools/testswarm/scripts/testswarm-mw-fetcher.php |
— | — | @@ -298,10 +298,15 @@ |
299 | 299 | public function mkdir( $path ) { |
300 | 300 | $this->debug( "Attempting to create directory '$path'...", __METHOD__ ); |
301 | 301 | if ( !file_exists( $path ) ) { |
302 | | - if ( mkdir( $path, 0777, true ) ) { |
303 | | - $this->debug( "Created directory '$path'", __METHOD__ ); |
304 | | - } else { |
305 | | - throw new Exception( __METHOD__ . ": Failed to create directory '$path'" ); |
| 302 | + try { |
| 303 | + if ( @mkdir( $path, 0777, true ) ) { |
| 304 | + $this->debug( "Created directory '$path'", __METHOD__ ); |
| 305 | + } else { |
| 306 | + throw new Exception( __METHOD__ . ": Failed to create directory '$path'" ); |
| 307 | + } |
| 308 | + } catch( Exception $e ) { |
| 309 | + print "Could not create directory '$path'. Exiting.\n"; |
| 310 | + exit(1); |
306 | 311 | } |
307 | 312 | } else { |
308 | 313 | $this->debug( "Creating directory '$path' aborted. Directory already exist", __METHOD__ ); |