lib/brief/document/section/builder.rb in brief-1.8.10 vs lib/brief/document/section/builder.rb in brief-1.8.11
- old
+ new
@@ -1,6 +1,8 @@
class Brief::Document::Section
+ BuilderError = Class.new(Exception)
+
class Builder
def self.run(source, options = {})
new(source, options).to_fragment
end
@@ -15,10 +17,14 @@
@low = options.fetch(:low, 1)
@high = options.fetch(:high, 6)
@nodes = []
@cycles = 0
- run
+ begin
+ run
+ rescue
+ raise BuilderError
+ end
end
def run
source.length.times do
source.each_with_index do |item, index|