lib/nanoc/base/errors.rb in nanoc-3.3.7 vs lib/nanoc/base/errors.rb in nanoc-3.4.0
- old
+ new
@@ -7,18 +7,23 @@
# Generic error. Superclass for all nanoc-specific errors.
class Generic < ::StandardError
end
+ # 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 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
def initialize(data_source_name)
- super("The data source specified in the site’s configuration file, “#{data_source_name}”, does not exist.".make_compatible_with_env)
+ super("The data source specified in the site’s configuration file, “#{data_source_name}”, does not exist.")
end
end
# Error that is raised during site compilation when an item uses a layout
@@ -26,11 +31,11 @@
class UnknownLayout < Generic
# @param [String] layout_identifier The layout identifier for which no
# layout could be found
def initialize(layout_identifier)
- super("The site does not have a layout with identifier “#{layout_identifier}”.".make_compatible_with_env)
+ super("The site does not have a layout with identifier “#{layout_identifier}”.")
end
end
# Error that is raised during site compilation when an item uses a filter
@@ -38,11 +43,11 @@
class UnknownFilter < Generic
# @param [Symbol] filter_name The filter name for which no filter could
# be found
def initialize(filter_name)
- super("The requested filter, “#{filter_name}”, does not exist.".make_compatible_with_env)
+ super("The requested filter, “#{filter_name}”, does not exist.")
end
end
# Error that is raised during site compilation when a layout is compiled
@@ -51,11 +56,11 @@
class CannotDetermineFilter < Generic
# @param [String] layout_identifier The identifier of the layout for
# which the filter could not be determined
def initialize(layout_identifier)
- super("The filter to be used for the “#{layout_identifier}” layout could not be determined. Make sure the layout does have a filter.".make_compatible_with_env)
+ super("The filter to be used for the “#{layout_identifier}” layout could not be determined. Make sure the layout does have a filter.")
end
end
# Error that is raised during site compilation when an item (directly or
@@ -64,21 +69,21 @@
# @param [Array<Nanoc::ItemRep>] reps A list of item representations
# that mutually depend on each other
def initialize(reps)
list = reps.map { |r| r.inspect }.join("\n")
- super("The site cannot be compiled because the following items mutually depend on each other:\n#{list}.".make_compatible_with_env)
+ super("The site cannot be compiled because the following items mutually depend on each other:\n#{list}.")
end
end
# Error that is raised when no rules file can be found in the current
# working directory.
class NoRulesFileFound < Generic
def initialize
- super("This site does not have a rules file, which is required for nanoc sites.".make_compatible_with_env)
+ super("This site does not have a rules file, which is required for nanoc sites.")
end
end
# Error that is raised when no compilation rule that can be applied to the
@@ -86,23 +91,23 @@
class NoMatchingCompilationRuleFound < Generic
# @param [Nanoc::Item] item The item for which no compilation rule
# could be found
def initialize(item)
- super("No compilation rules were found for the “#{item.identifier}” item.".make_compatible_with_env)
+ super("No compilation rules were found for the “#{item.identifier}” item.")
end
end
# Error that is raised when no routing rule that can be applied to the
# current item can be found.
class NoMatchingRoutingRuleFound < Generic
- # @param [Nanoc::Item] item The item for which no routing rule could be
- # found
+ # @param [Nanoc::ItemRep] rep The item repiresentation for which no
+ # routing rule could be found
def initialize(rep)
- super("No routing rules were found for the “#{rep.item.identifier}” item (rep “#{rep.name}”).".make_compatible_with_env)
+ super("No routing rules were found for the “#{rep.item.identifier}” item (rep “#{rep.name}”).")
end
end
# Error that is raised when an rep cannot be compiled because it depends
@@ -111,26 +116,26 @@
# @return [Nanoc::ItemRep] The item representation that cannot yet be
# compiled
attr_reader :rep
- # @param [Nanoc::ItemRep] The item representation that cannot yet be
+ # @param [Nanoc::ItemRep] rep The item representation that cannot yet be
# compiled
def initialize(rep)
@rep = rep
- super("The current item cannot be compiled yet because of an unmet dependency on the “#{rep.item.identifier}” item (rep “#{rep.name}”).".make_compatible_with_env)
+ super("The current item cannot be compiled yet because of an unmet dependency on the “#{rep.item.identifier}” item (rep “#{rep.name}”).")
end
end
# Error that is raised when a binary item is attempted to be laid out.
class CannotLayoutBinaryItem < Generic
- # @param [Nanoc::ItemRep] The item representation that was attempted to
- # be laid out
+ # @param [Nanoc::ItemRep] rep The item representation that was attempted
+ # to be laid out
def initialize(rep)
- super("The “{rep.item.identifier}” item (rep “#{rep.name}”) cannot be laid out because it is a binary item. If you are getting this error for an item that should be textual instead of binary, make sure that its extension is included in the text_extensions array in the site configuration.".make_compatible_with_env)
+ super("The “{rep.item.identifier}” item (rep “#{rep.name}”) cannot be laid out because it is a binary item. If you are getting this error for an item that should be textual instead of binary, make sure that its extension is included in the text_extensions array in the site configuration.")
end
end
# Error that is raised when a textual filter is attempted to be applied to
@@ -140,11 +145,11 @@
# @param [Nanoc::ItemRep] rep The item representation that was
# attempted to be filtered
#
# @param [Class] filter_class The filter class that was used
def initialize(rep, filter_class)
- super("The “#{filter_class.inspect}” filter cannot be used to filter the “#{rep.item.identifier}” item (rep “#{rep.name}”), because textual filters cannot be used on binary items.".make_compatible_with_env)
+ super("The “#{filter_class.inspect}” filter cannot be used to filter the “#{rep.item.identifier}” item (rep “#{rep.name}”), because textual filters cannot be used on binary items.")
end
end
# Error that is raised when a binary filter is attempted to be applied to
@@ -154,11 +159,11 @@
# @param [Nanoc::ItemRep] rep The item representation that was
# attempted to be filtered
#
# @param [Class] filter_class The filter class that was used
def initialize(rep, filter_class)
- super("The “#{filter_class.inspect}” filter cannot be used to filter the “#{rep.item.identifier}” item (rep “#{rep.name}”), because binary filters cannot be used on textual items. If you are getting this error for an item that should be textual instead of binary, make sure that its extension is included in the text_extensions array in the site configuration.".make_compatible_with_env)
+ super("The “#{filter_class.inspect}” filter cannot be used to filter the “#{rep.item.identifier}” item (rep “#{rep.name}”), because binary filters cannot be used on textual items. If you are getting this error for an item that should be textual instead of binary, make sure that its extension is included in the text_extensions array in the site configuration.")
end
end
# Error that is raised when the compiled content at a non-existing snapshot
@@ -190,19 +195,19 @@
# snapshot was attempted to be made
#
# @param [Symbol] snapshot The name of the snapshot that was attempted to
# be made
def initialize(rep, snapshot)
- super("Attempted to create a snapshot with a duplicate name #{snapshot.inspect} for the item rep “#{rep.inspect}”".make_compatible_with_env)
+ super("Attempted to create a snapshot with a duplicate name #{snapshot.inspect} for the item rep “#{rep.inspect}”")
end
end
# @deprecated No longer necessary, but kept for backwards compatibility.
class DataNotYetAvailable < Generic
def initialize(type, plural)
- super("#{type} #{plural ? 'are' : 'is'} not available yet. You may be missing a Nanoc::Site#load_data call.".make_compatible_with_env)
+ super("#{type} #{plural ? 'are' : 'is'} not available yet. You may be missing a Nanoc::Site#load_data call.")
end
end
end