Sha256: c20ceb8ed46c9e5aa23d319587f5ac286a0d04aa3fd53472fc3b388ce392d97e

Contents?: true

Size: 442 Bytes

Versions: 9

Compression:

Stored size: 442 Bytes

Contents

module UltraCommandLine
  module Utils

    module ErrorPropagation

      DEFAULT_ERROR_MESSAGE = 'Error message not provided!'.freeze

      private

      def false_or_raise(message = DEFAULT_ERROR_MESSAGE, raise_error: false, error_type: UltraCommandLine::Error)
        if raise_error
          raise error_type, message
        else
          UltraCommandLine.logger.warn message
        end
        false
      end

    end

  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
ultra_command_line-0.4.16 lib/ultra_command_line/utils/error_propagation.rb
ultra_command_line-0.4.15 lib/ultra_command_line/utils/error_propagation.rb
ultra_command_line-0.4.14 lib/ultra_command_line/utils/error_propagation.rb
ultra_command_line-0.4.13 lib/ultra_command_line/utils/error_propagation.rb
ultra_command_line-0.4.12 lib/ultra_command_line/utils/error_propagation.rb
ultra_command_line-0.4.10 lib/ultra_command_line/utils/error_propagation.rb
ultra_command_line-0.4.9 lib/ultra_command_line/utils/error_propagation.rb
ultra_command_line-0.4.8 lib/ultra_command_line/utils/error_propagation.rb
ultra_command_line-0.4.7 lib/ultra_command_line/utils/error_propagation.rb