From f8b2f203a1f62f1fcf6a529529f9b36c87c8128f Mon Sep 17 00:00:00 2001 From: Andrea Turso Date: Tue, 15 May 2012 21:47:17 +0100 Subject: [PATCH] Added exception class and message to the error string. --- src/Composer/Script/EventDispatcher.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Composer/Script/EventDispatcher.php b/src/Composer/Script/EventDispatcher.php index 3b420ba70..55519c803 100644 --- a/src/Composer/Script/EventDispatcher.php +++ b/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())); } } }