From cf6db82649edfbc64ea84b8f58cdab620b959095 Mon Sep 17 00:00:00 2001 From: LightGuard Date: Wed, 9 Apr 2014 11:22:39 -0600 Subject: [PATCH] Error reporting is a bit better now Now you can see the actual page the error happened in, and the correct page to view the error. --- lib/awestruct/handlers/base_tilt_handler.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/awestruct/handlers/base_tilt_handler.rb b/lib/awestruct/handlers/base_tilt_handler.rb index fb7ca702..ec2c7042 100644 --- a/lib/awestruct/handlers/base_tilt_handler.rb +++ b/lib/awestruct/handlers/base_tilt_handler.rb @@ -138,8 +138,13 @@ def rendered_content(context, with_layouts=true) ExceptionHelper.log_message "Please see #{File.join site.dir, output_path} for more information" return ExceptionHelper.html_error_report e, relative_source_path rescue Exception => e - ExceptionHelper.log_message "An error during rendering #{File.join site.dir, relative_source_path} occurred." - ExceptionHelper.log_message "Please see #{File.join site.dir, output_path} for more information" + error_page = context[:page] + if error_page[:__is_layout] + ExceptionHelper.log_message "An error during rendering layout file #{File.join site.dir, error_page.source_path} occurred." + else + ExceptionHelper.log_message "An error during rendering #{File.join site.dir, error_page.source_path} occurred." + end + ExceptionHelper.log_message "Please see #{File.join site.dir, error_page.output_path} for more information" return ExceptionHelper.html_error_report e, relative_source_path end end