Replace getExceptionID() by logThrowable()
authorTim Düsterhus <duesterhus@woltlab.com>
Wed, 6 Jan 2016 17:01:17 +0000 (18:01 +0100)
committerTim Düsterhus <duesterhus@woltlab.com>
Wed, 6 Jan 2016 17:01:17 +0000 (18:01 +0100)
wcfsetup/install/files/lib/system/background/BackgroundQueueHandler.class.php
wcfsetup/install/files/lib/system/background/job/EmailDeliveryBackgroundJob.class.php
wcfsetup/install/files/lib/system/cronjob/BackgroundQueueCleanUpCronjob.class.php
wcfsetup/install/files/lib/system/email/transport/exception/PermanentFailure.class.php
wcfsetup/install/files/lib/system/email/transport/exception/TransientFailure.class.php
wcfsetup/install/files/lib/system/recaptcha/RecaptchaHandlerV2.class.php
wcfsetup/install/files/lib/system/user/storage/UserStorageHandler.class.php

index dedd7dd6563a1ebcfc5c27cce9bc19de58c824ca..071161a84f039c08fb413f1e9d7677e082b3a573 100644 (file)
@@ -101,7 +101,7 @@ class BackgroundQueueHandler extends SingletonFactory {
                        }
                        else {
                                // job failed too often: log
-                               if ($e instanceof LoggedException) $e->getExceptionID();
+                               \wcf\functions\exception\logThrowable($e);
                        }
                }
                finally {
@@ -170,7 +170,7 @@ class BackgroundQueueHandler extends SingletonFactory {
                }
                catch (\Exception $e) {
                        // job is completely broken: log
-                       if ($e instanceof LoggedException) $e->getExceptionID();
+                       \wcf\functions\exception\logThrowable($e);
                }
                finally {
                        // remove entry of processed job
index 8d013fe6fd0e5627ade4445e80f58f648784b4b7..c7af633e1f0ba8f48566e54c409faf27208800cb 100644 (file)
@@ -76,7 +76,7 @@ class EmailDeliveryBackgroundJob extends AbstractBackgroundJob {
                }
                catch (PermanentFailure $e) {
                        // no need for retrying. Eat Exception and log the error.
-                       $e->getExceptionID();
+                       \wcf\functions\exception\logThrowable($e);
                }
        }
 }
index 882d8646aa2ed440f712155b89ad2d2710cc1f7a..b5caf9d8542d320fd061e7885648e019a850ad9e 100644 (file)
@@ -55,7 +55,7 @@ class BackgroundQueueCleanUpCronjob extends AbstractCronjob {
                                }
                                catch (\Exception $e) {
                                        // job is completely broken: log
-                                       if ($e instanceof LoggedException) $e->getExceptionID();
+                                       \wcf\functions\exception\logThrowable($e);
                                }
                        }
                        
index a2dc7c1f196c812dd0b68aec451a66fd311f70bd..c49fe90ec8006f427a0d524b7dd679216410a8ca 100644 (file)
@@ -1,6 +1,5 @@
 <?php
 namespace wcf\system\email\transport\exception;
-use wcf\system\exception\SystemException;
 
 /**
  * Denotes a permanent failure during delivery. It should not be retried later.
@@ -13,4 +12,4 @@ use wcf\system\exception\SystemException;
  * @category   Community Framework
  * @since      2.2
  */
-class PermanentFailure extends SystemException { }
+class PermanentFailure extends \Exception { }
index 66aeb3e33ca049853e809f0061782122bb50e2af..8dda54818868df5e0ab07ca5809831e6d2b537ee 100644 (file)
@@ -1,6 +1,5 @@
 <?php
 namespace wcf\system\email\transport\exception;
-use wcf\system\exception\SystemException;
 
 /**
  * Denotes a transient failure during delivery. It may be retried later.
@@ -13,4 +12,4 @@ use wcf\system\exception\SystemException;
  * @category   Community Framework
  * @since      2.2
  */
-class TransientFailure extends SystemException { }
+class TransientFailure extends \Exception { }
index 7d9fff32171f2e0cc97fe5a24ef66af5ccd4d531..30f9fb5cf0326067e15c3b55b7c4e160e283f95f 100644 (file)
@@ -44,9 +44,9 @@ class RecaptchaHandlerV2 extends SingletonFactory {
                                throw new UserInputException('recaptchaString', 'false');
                        }
                }
-               catch (SystemException $e) {
+               catch (\Exception $e) {
                        // log error, but accept captcha
-                       $e->getExceptionID();
+                       \wcf\functions\exception\logThrowable($e);
                }
                
                WCF::getSession()->register('recaptchaDone', true);
index 712d922f24906563ecfc2908b20349f1591ae1dc..dfe02e32831be0ac101197875b93ac1bf919b32c 100644 (file)
@@ -248,12 +248,12 @@ class UserStorageHandler extends SingletonFactory {
                                WCF::getDB()->commitTransaction();
                                break;
                        }
-                       catch (SystemException $e) {
+                       catch (\Exception $e) {
                                WCF::getDB()->rollbackTransaction();
                                
                                // retry up to 2 times
                                if (++$i === 2) {
-                                       $e->getExceptionID();
+                                       \wcf\functions\exception\logThrowable($e);
                                        break;
                                }