diff --git a/src/ContaoCommunityAlliance/Composer/Plugin/RunonceExecutor.php b/src/ContaoCommunityAlliance/Composer/Plugin/RunonceExecutor.php
index <HASH>..<HASH> 100644
--- a/src/ContaoCommunityAlliance/Composer/Plugin/RunonceExecutor.php
+++ b/src/ContaoCommunityAlliance/Composer/Plugin/RunonceExecutor.php
@@ -41,7 +41,7 @@ class RunonceExecutor extends \System
     public function run(array $runonces)
     {
         // handle errors as exceptions
-        $previousErrorHandler = set_error_handler(array($this, 'handleError'), (E_ALL & ~E_NOTICE));
+        set_error_handler(array($this, 'handleError'), (E_ALL & ~E_NOTICE));
 
         foreach ($runonces as $runonce) {
             try {
@@ -60,7 +60,7 @@ class RunonceExecutor extends \System
         }
 
         // restore contao error handler
-        set_error_handler($previousErrorHandler);
+        restore_error_handler();
     }
 
     /**
Use native restore_error_handler as it also recognize the set error_types setting.