lib/blueprints/errors.rb in blueprints-0.7.3 vs lib/blueprints/errors.rb in blueprints-0.8.0

- old
+ new

@@ -1,12 +1,24 @@ module Blueprints - # Is raised when blueprint or namespace is not found. - class BlueprintNotFoundError < NameError - def initialize(*args) - @blueprints = args + class Error < StandardError + def initialize(blueprint) + @name = blueprint end def to_s - "Blueprint/namespace not found '#{@blueprints.join(',')}'" + "Blueprint '#{@name}' #{message_append}" + end + end + + class DemolishError < Error + def message_append + 'must be built before demolishing' + end + end + + # Is raised when blueprint or namespace is not found. + class BlueprintNotFoundError < Error + def message_append + 'not found' end end end