Pārlūkot izejas kodu

Added exception class and message to the error string.

Andrea Turso 13 gadi atpakaļ
vecāks
revīzija
f8b2f203a1
1 mainītis faili ar 5 papildinājumiem un 1 dzēšanām
  1. 5 1
      src/Composer/Script/EventDispatcher.php

+ 5 - 1
src/Composer/Script/EventDispatcher.php

@@ -94,7 +94,11 @@ class EventDispatcher
             try {
                 $className::$methodName($event);
             } catch (\Exception $e) {
-                throw new \RuntimeException("'{$callable}' terminated with an exception.");
+                $message = "%s terminated with an exception.\n[%s] %s";
+                throw new \RuntimeException(sprintf($message,
+                                                    $callable,
+                                                    get_class($e),
+                                                    $e->getMessage()));
             }
         }
     }