lib/awestruct/extensions/relative.rb in awestruct-0.4.8 vs lib/awestruct/extensions/relative.rb in awestruct-0.5.0.cr

- old
+ new

@@ -3,11 +3,16 @@ module Awestruct module Extensions module Relative def relative(href, p = page) - Pathname.new(href).relative_path_from(Pathname.new(File.dirname(p.output_path))).to_s + begin + Pathname.new(href).relative_path_from(Pathname.new(File.dirname(p.output_path))).to_s + rescue Exception => e + $LOG.error "#{e}" if $LOG.error? + $LOG.error "#{e.backtrace.join("\n")}" if $LOG.error? + end end end end -end \ No newline at end of file +end