Skip to content

Commit

Permalink
properly scope FatalException
Browse files Browse the repository at this point in the history
  • Loading branch information
darwin committed Jan 6, 2017
1 parent a77621f commit 694742b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion _plugins/_shared.rb
Expand Up @@ -9,7 +9,7 @@
class SimpleLogger
def error(msg)
STDERR.puts(msg)
raise FatalException.new("HtmlPress: #{msg}")
raise Jekyll::Errors::FatalException.new("HtmlPress: #{msg}")
end
end

Expand Down
10 changes: 5 additions & 5 deletions _plugins/cdnizer.rb
Expand Up @@ -94,7 +94,7 @@ def prepare_static_zone!

def clean_static_zone!
zone_dir = config['static_cdn']['zone']
raise FatalException.new("CDN error: specify config['static_cdn']['zone']") unless zone_dir
raise Jekyll::Errors::FatalException.new("CDN error: specify config['static_cdn']['zone']") unless zone_dir
list = Dir.glob(File.join(zone_dir, '*'))
puts "#{'STATIC CDN '.magenta} cleaning #{"#{list.size} files".green} in zone folder: #{zone_dir.yellow}"
FileUtils.rm(list)
Expand All @@ -117,7 +117,7 @@ def push_static_zone_to_cdn!
end
puts "> #{cmd.blue}"
unless system(cmd)
raise FatalException.new("rsync failed with code #{$?}")
raise Jekyll::Errors::FatalException.new("rsync failed with code #{$?}")
end
end

Expand All @@ -138,7 +138,7 @@ def push_to_cdn!(generated_web_dir)
end
puts "> #{cmd.blue}"
unless system(cmd)
raise FatalException.new("rsync failed with code #{$?}")
raise Jekyll::Errors::FatalException.new("rsync failed with code #{$?}")
end
end

Expand All @@ -151,7 +151,7 @@ def retrieve_cnd_id(api_login, api_password, target_url)
puts "> #{cmd.blue}"
json_string = Open3.popen3(cmd) { |_stdin, stdout, _stderr, _wait_thr| stdout.read }
unless $? == 0
raise FatalException.new("curl failed with code #{$?}")
raise Jekyll::Errors::FatalException.new("curl failed with code #{$?}")
end
stage = target_url_to_stage(target_url)
begin
Expand Down Expand Up @@ -180,7 +180,7 @@ def purge_cdn!
cmd = "curl --data \"cdn_id=#{cdn_id}&login=#{api_login}&passwd=#{api_password}\" https://api.cdn77.com/v2.0/data/purge-all"
puts "> #{cmd.blue}"
unless system(cmd)
raise FatalException.new("curl failed with code #{$?}")
raise Jekyll::Errors::FatalException.new("curl failed with code #{$?}")
end
else
puts 'set ENV variables CDN77_API_LOGIN and CDN77_API_PASSWORD for purging CDN'.red
Expand Down
2 changes: 1 addition & 1 deletion _plugins/js_combinator.rb
Expand Up @@ -56,7 +56,7 @@ def write(dest)
end
rescue => e
STDERR.puts "Closure Compiler Exception: #{e.message}"
raise FatalException.new("Closure Compiler: #{e.message}")
raise Jekyll::Errors::FatalException.new("Closure Compiler: #{e.message}")
end

true
Expand Down

0 comments on commit 694742b

Please sign in to comment.