Sha256: fc58910de5f13057d03efb804fef53431f0e39fe8d1e989cffbde3f66c086b13

Contents?: true

Size: 1.48 KB

Versions: 16

Compression:

Stored size: 1.48 KB

Contents

module Cany
  # Cany base error, design to catch all Cany errors at once
  class Error < StandardError
  end

  class MissingSpecification < Error
    def initialize(directory)
      super "No #{Specification::EXT} found in #{directory}"
    end
  end

  class MultipleSpecifications < Error
    def initialize(directory)
      super "Multiple #{Specification::EXT} found in #{directory}"
    end
  end

  class CommandExecutionFailed < Error
    def initialize(args)
      super "Could not execute: #{args.join(' ')}"
    end
  end

  class UnknownHook < Error
    def initialize(hook)
      super "Unknown hook \"#{hook}\""
    end
  end

  class UnknownOption < Error
    def initialize(option)
      super "Unknown option \"#{option}\""
    end
  end

  class UnloadedRecipe < Error
    def initialize(name)
      super "The recipe \"#{name}\" is not loaded by the specification."
    end
  end

  class UnknownRecipe < Error
    def initialize(name)
      super "The recipe \"#{name}\" is not registered!"
    end
  end

  class NoSystemRecipe < Error
    def initialize
      super "The specification has no loaded system recipe."
    end
  end

  # This exception is raised if the running Cany version satisfies not the
  # required Cany version constraint from the canspec.
  class UnsupportedVersion < Error
    def initialize(required_version)
      super "The package specification requires Cany in version" \
        " \"#{required_version}\" but Cany has version \"#{Cany::VERSION}\""
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
cany-0.5.7 lib/cany/errors.rb
cany-0.5.6 lib/cany/errors.rb
cany-0.5.5 lib/cany/errors.rb
cany-0.5.4 lib/cany/errors.rb
cany-0.5.3 lib/cany/errors.rb
cany-0.5.2 lib/cany/errors.rb
cany-0.5.1 lib/cany/errors.rb
cany-0.5.0 lib/cany/errors.rb
cany-0.4.0 lib/cany/errors.rb
cany-0.3.0 lib/cany/errors.rb
cany-0.2.1 lib/cany/errors.rb
cany-0.2.0 lib/cany/errors.rb
cany-0.1.3 lib/cany/errors.rb
cany-0.1.2 lib/cany/errors.rb
cany-0.1.1 lib/cany/errors.rb
cany-0.1.0 lib/cany/errors.rb