Sha256: c2f5a62045b48f99d3e445260f70611a65975126daa8cf9ad589383bfbe229a8

Contents?: true

Size: 1.23 KB

Versions: 2

Compression:

Stored size: 1.23 KB

Contents

# frozen_string_literal: true

# rubocop:disable Style/Documentation

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

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

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

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

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

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

# rubocop:enable Style/Documentation

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
coltrane-2.2.1 lib/cli/errors.rb
coltrane-2.1.5 lib/cli/errors.rb