Sha256: 25ed757dfee2f115c3252dec561ca71afff13c6f5bc5525dfcb1ac61a01a9455

Contents?: true

Size: 1.12 KB

Versions: 15

Compression:

Stored size: 1.12 KB

Contents

# frozen_string_literal: true

# rubocop:disable Style/Documentation

module Coltrane
  class CommandError < StandardError
    def initialize(msg)
      super msg
    end
  end

  class WrongFlavorError < CommandError
    def initialize(msg = nil)
      super msg || 'Wrong flavor. Check possible flavors with `coltrane list flavors`.'
    end
  end

  class BadFindScales < CommandError
    def initialize(msg = nil)
      super msg || 'Provide --notes or --chords. Ex: `coltrane find-scale --notes C-E-G`.'
    end
  end

  class WrongRepresentationTypeError < CommandError
    def initialize(type)
      super "The provided representation type (#{type}) "\
            'is not available at the moment.'
    end
  end

  class BadScaleError < CommandError
    def initialize(msg = nil)
      super msg || 'Incorrect scale, please specify scale and root separated by `-`. Ex: `coltrane scale major-C'
    end
  end

  class BadChordError < CommandError
    def initialize(msg = nil)
      super msg || 'Incorrect chord, please specify a set of chords separated by `-`. Ex: coltrane chord CM7'
    end
  end
end

# rubocop:enable Style/Documentation

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
coltrane-3.4.2 lib/coltrane/commands/errors.rb
coltrane-3.4.1 lib/coltrane/commands/errors.rb
coltrane-3.4.0 lib/coltrane/commands/errors.rb
coltrane-3.3.3 lib/coltrane/commands/errors.rb
coltrane-3.3.2 lib/coltrane/commands/errors.rb
coltrane-3.3.1 lib/coltrane/commands/errors.rb
coltrane-3.3.0 lib/coltrane/commands/errors.rb
coltrane-3.2.0 lib/coltrane/commands/errors.rb
coltrane-3.1.3 lib/coltrane/commands/errors.rb
coltrane-3.1.2 lib/coltrane/commands/errors.rb
coltrane-3.1.1 lib/coltrane/commands/errors.rb
coltrane-3.1.0 lib/coltrane/commands/errors.rb
coltrane-3.0.0 lib/coltrane/commands/errors.rb
coltrane-3.0.0.rc1 lib/coltrane/commands/errors.rb
coltrane-3.0.0.pre lib/coltrane/commands/errors.rb