-$handler = thumbGetHandler( $fileName );
-if ( $handler ) {
- $imagePath = wfImageDir( $fileName ) . '/' . $fileName;
- $thumbName = $handler->makeParamString( $params ) . "-$fileName";
- $thumbPath = wfImageThumbDir( $fileName ) . '/' . $thumbName;
-
- if ( is_file( $thumbPath ) && filemtime( $thumbPath ) >= filemtime( $imagePath ) ) {
- wfStreamFile( $thumbPath );
- // Can't log profiling data with no Setup.php
- exit;
+try {
+ $handler = thumbGetHandler( $fileName );
+ if ( $handler ) {
+ $imagePath = wfImageDir( $fileName ) . '/' . $fileName;
+ $thumbName = $handler->makeParamString( $params ) . "-$fileName";
+ $thumbPath = wfImageThumbDir( $fileName ) . '/' . $thumbName;
+
+ if ( is_file( $thumbPath ) && filemtime( $thumbPath ) >= filemtime( $imagePath ) ) {
+ wfStreamFile( $thumbPath );
+ // Can't log profiling data with no Setup.php
+ exit;
+ }