lib/nanoc/base/errors.rb in nanoc-4.4.1 vs lib/nanoc/base/errors.rb in nanoc-4.4.2

- old
+ new

@@ -8,9 +8,24 @@ # Generic trivial error. Superclass for all Nanoc-specific errors that are # considered "trivial", i.e. errors that do not require a full crash report. class GenericTrivial < Generic end + # Error that is raised when compilation of an item rep fails. The + # underlying error is available by calling `#unwrap`. + class CompilationError < Generic + attr_reader :item_rep + + def initialize(wrapped, item_rep) + @wrapped = wrapped + @item_rep = item_rep + end + + def unwrap + @wrapped + end + end + # Error that is raised when a site is loaded that uses a data source with # an unknown identifier. class UnknownDataSource < Generic # @param [String] data_source_name The data source name for which no # data source could be found