lib/macros4cuke/exceptions.rb in macros4cuke-0.4.09 vs lib/macros4cuke/exceptions.rb in macros4cuke-0.5.03

- old
+ new

@@ -5,14 +5,38 @@ # @abstract # Base class for any exception explicitly raised in the Macros4Cuke methods. class Macros4CukeError < StandardError end # class +# @abstract +# Specialized command-line errors. +class CmdLineError < Macros4CukeError + def initialize(aMessage) + msg = "Error in command-line:\n" + super(msg + aMessage) + end +end # class + +class DirectoryNotFound < CmdLineError + def initialize(aDirPath) + msg = "Cannot find the directory '#{aDirPath}'." + super(msg) + end +end # class + + +class SupportFileExists < CmdLineError + def initialize(aDirPath) + msg = "The file '#{aDirPath}' already exists." + super(msg) + end +end # class + # Raised when one attempts to define a new macro # that has the same phrase as an existing macro. class DuplicateMacroError < Macros4CukeError def initialize(aPhrase) - super("A macro-step with phrase '#{aPhrase}' already exist.") + super("A macro-step with phrase '#{aPhrase}' already exists.") end end # class # Raised when one defines an argument name in a macro-step's phrase # and that argument name does not appear in any sub-step.