$retval = call_user_func_array( $callback, $hook_args );
} catch ( MWHookException $e ) {
$badhookmsg = $e->getMessage();
+ } catch ( Exception $e ) {
+ restore_error_handler();
+ throw $e;
}
restore_error_handler();
wfProfileOut( $func );
ini_set( 'html_errors', '0' );
set_error_handler( 'UserMailer::errorHandler' );
- $safeMode = wfIniGetBool( 'safe_mode' );
-
- foreach ( $to as $recip ) {
- if ( $safeMode ) {
- $sent = mail( $recip, self::quotedPrintable( $subject ), $body, $headers );
- } else {
- $sent = mail( $recip, self::quotedPrintable( $subject ), $body, $headers, $wgAdditionalMailParams );
+ try {
+ $safeMode = wfIniGetBool( 'safe_mode' );
+
+ foreach ( $to as $recip ) {
+ if ( $safeMode ) {
+ $sent = mail( $recip, self::quotedPrintable( $subject ), $body, $headers );
+ } else {
+ $sent = mail( $recip, self::quotedPrintable( $subject ), $body, $headers, $wgAdditionalMailParams );
+ }
}
+ } catch ( Exception $e ) {
+ restore_error_handler();
+ throw $e;
}
restore_error_handler();
} catch ( Exception $ex ) {
wfProfileOut( "dbconnect-$server" );
wfProfileOut( __METHOD__ );
+ $this->restoreErrorHandler();
throw $ex;
}
$error = $this->restoreErrorHandler();
$this->connectString = $this->makeConnectionString( $connectVars, PGSQL_CONNECT_FORCE_NEW );
$this->close();
$this->installErrorHandler();
- $this->mConn = pg_connect( $this->connectString );
+
+ try {
+ $this->mConn = pg_connect( $this->connectString );
+ } catch ( Exception $ex ) {
+ $this->restoreErrorHandler();
+ throw $ex;
+ }
+
$phpError = $this->restoreErrorHandler();
if ( !$this->mConn ) {
$this->phpErrors = array();
set_error_handler( array( $this, 'errorHandler' ) );
- session_start();
+ try {
+ session_start();
+ } catch ( Exception $e ) {
+ restore_error_handler();
+ throw $e;
+ }
restore_error_handler();
if ( $this->phpErrors ) {