From 41ca2b0195bf6a29429dfc5405f3c2073b1c3aba Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 19 Jun 2010 13:52:48 -0700 Subject: Rework our exception framework to fit into Kohana's model better. Instead of overwriting Kohana_Exception::handle() (which we were doing in MY_Kohana_Exception) we instead use their existing template system. gallery/views/kohana/error.php overrides system/views/kohana/error.php and is the standard error template for all exceptions. Our version of error.php figures out the appropriate view based on context (cli, authenticated admin, guest viewing a 404, guest viewing a system error) and delegates appropriately. Each delegated view has a narrow responsibility. This paves the way for us to add new error views per module. For example, the rest module will define its own template in Rest_Exception and then its exceptions can be rendered the way that it wants (json encoded, in that case). --- modules/gallery/views/error_cli.txt.php | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 modules/gallery/views/error_cli.txt.php (limited to 'modules/gallery/views/error_cli.txt.php') diff --git a/modules/gallery/views/error_cli.txt.php b/modules/gallery/views/error_cli.txt.php new file mode 100644 index 00000000..b4f87fa6 --- /dev/null +++ b/modules/gallery/views/error_cli.txt.php @@ -0,0 +1,3 @@ + + + -- cgit v1.2.3 From 719328a5a7c0086fb97f0dd6b54d5db839696d33 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 20 Jun 2010 09:02:59 -0700 Subject: If we use on the last line, it looks like we've got a trailing ?> and that causes File_Structure_Test to be sad. So instead use echo and tack on our own newline. But this also requires a semicolon. Weird, I know but still easier than fixing up the test. --- modules/gallery/views/error_cli.txt.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/gallery/views/error_cli.txt.php') diff --git a/modules/gallery/views/error_cli.txt.php b/modules/gallery/views/error_cli.txt.php index b4f87fa6..9f476f54 100644 --- a/modules/gallery/views/error_cli.txt.php +++ b/modules/gallery/views/error_cli.txt.php @@ -1,3 +1,3 @@ - +