From 91a540c266392478ef31eb2416fe2ba42a2db05d Mon Sep 17 00:00:00 2001 From: Joseph Wynn Date: Thu, 5 Sep 2019 14:45:32 +1200 Subject: [PATCH] Warn when image doesn't exist instead of throwing SyntaxError --- features/responsive-image-block.feature | 2 +- lib/jekyll-responsive-image/image_processor.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/features/responsive-image-block.feature b/features/responsive-image-block.feature index e91a37c..01b4494 100644 --- a/features/responsive-image-block.feature +++ b/features/responsive-image-block.feature @@ -56,4 +56,4 @@ Feature: Jekyll responsive_image_block tag path: {{ path }} {% endresponsive_image_block %} """ - Then Jekyll should throw a "SyntaxError" + Then Jekyll should throw a "Magick::ImageMagickError" diff --git a/lib/jekyll-responsive-image/image_processor.rb b/lib/jekyll-responsive-image/image_processor.rb index ca102be..f3cd6a6 100644 --- a/lib/jekyll-responsive-image/image_processor.rb +++ b/lib/jekyll-responsive-image/image_processor.rb @@ -6,7 +6,7 @@ module Jekyll def process(image_path, config) absolute_image_path = File.expand_path(image_path.to_s, config[:site_source]) - raise SyntaxError.new("Invalid image path specified: #{image_path}") unless File.file?(absolute_image_path) + Jekyll.logger.warn "Invalid image path specified: #{image_path.inspect}" unless File.file?(absolute_image_path) resize_handler = ResizeHandler.new img = Magick::Image::read(absolute_image_path).first