From 3ef22d9d1a42e6f4ac1ebf32bceceb0e6fa03b4d Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 17 Jan 2010 18:09:31 -0800 Subject: Add special output support for ORM_Validation_Exception --- modules/gallery_unit_test/views/kohana_unit_test_cli.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'modules/gallery_unit_test/views') diff --git a/modules/gallery_unit_test/views/kohana_unit_test_cli.php b/modules/gallery_unit_test/views/kohana_unit_test_cli.php index 3203ee44..a0de0f52 100644 --- a/modules/gallery_unit_test/views/kohana_unit_test_cli.php +++ b/modules/gallery_unit_test/views/kohana_unit_test_cli.php @@ -57,6 +57,12 @@ foreach ($results as $class => $methods) { if ($result->getMessage()) { echo " ", $result->getMessage(), "\n"; } + if ($result instanceof ORM_Validation_Exception) { + echo " Validation errors:\n"; + foreach ($result->validation->errors() as $key => $value) { + echo " $key: $value\n"; + } + } echo " ", $result->getFile(), " (Line ", $result->getLine(), ")\n"; echo "\n"; echo $result->getTraceAsString(), "\n"; -- cgit v1.2.3 From 382214f3c13cc2ae4b927e37de7bc6e798fe900a Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Wed, 20 Jan 2010 23:00:39 -0800 Subject: Move the error page to the expected location for K24. --- modules/gallery_unit_test/views/kohana/error.php | 18 ++++++++++++++++++ modules/gallery_unit_test/views/kohana_error_page.php | 18 ------------------ 2 files changed, 18 insertions(+), 18 deletions(-) create mode 100644 modules/gallery_unit_test/views/kohana/error.php delete mode 100644 modules/gallery_unit_test/views/kohana_error_page.php (limited to 'modules/gallery_unit_test/views') diff --git a/modules/gallery_unit_test/views/kohana/error.php b/modules/gallery_unit_test/views/kohana/error.php new file mode 100644 index 00000000..c0ae7173 --- /dev/null +++ b/modules/gallery_unit_test/views/kohana/error.php @@ -0,0 +1,18 @@ + +/', '/<(.*?)>/', '/>/'), + array(" ", '', '>'), + $trace); + echo "Stack Trace:\n"; + echo $trace, "\n"; +} + diff --git a/modules/gallery_unit_test/views/kohana_error_page.php b/modules/gallery_unit_test/views/kohana_error_page.php deleted file mode 100644 index c0ae7173..00000000 --- a/modules/gallery_unit_test/views/kohana_error_page.php +++ /dev/null @@ -1,18 +0,0 @@ - -/', '/<(.*?)>/', '/>/'), - array(" ", '', '>'), - $trace); - echo "Stack Trace:\n"; - echo $trace, "\n"; -} - -- cgit v1.2.3 From 3f3159d25caaea0c46583a6505c5dcc03b4fafe2 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Wed, 20 Jan 2010 23:05:51 -0800 Subject: Guard against missing/empty $description. --- modules/gallery_unit_test/views/kohana/error.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'modules/gallery_unit_test/views') diff --git a/modules/gallery_unit_test/views/kohana/error.php b/modules/gallery_unit_test/views/kohana/error.php index c0ae7173..34053317 100644 --- a/modules/gallery_unit_test/views/kohana/error.php +++ b/modules/gallery_unit_test/views/kohana/error.php @@ -1,7 +1,9 @@ Date: Wed, 20 Jan 2010 23:14:51 -0800 Subject: Use the exception itself to print out a nice text message. --- modules/gallery_unit_test/views/kohana/error.php | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) (limited to 'modules/gallery_unit_test/views') diff --git a/modules/gallery_unit_test/views/kohana/error.php b/modules/gallery_unit_test/views/kohana/error.php index 34053317..079a279b 100644 --- a/modules/gallery_unit_test/views/kohana/error.php +++ b/modules/gallery_unit_test/views/kohana/error.php @@ -1,20 +1,6 @@ /', '/<(.*?)>/', '/>/'), - array(" ", '', '>'), - $trace); - echo "Stack Trace:\n"; - echo $trace, "\n"; -} +echo $e->getMessage(), "\n"; +echo $e->getFile(), ":", $e->getLine(), "\n"; +echo $e->getTraceAsString(), "\n"; -- cgit v1.2.3