Sha256: fb5473cf8fca02d62763209a1d75e93b51aa3a07570c54223c66fdfc88639cfd

Contents?: true

Size: 399 Bytes

Versions: 18

Compression:

Stored size: 399 Bytes

Contents

module CustomErrors
  class ParseError < StandardError
    def initialize(msg, path = nil)
      super(format_msg(msg, path).squeeze(' '))
    end

    private

    def format_msg(msg, path)
      if path.nil?
        %(There was an error while parsing a file:
        #{msg})
      else
        %(There was an error while parsing a file:
        #{path}
        #{msg})
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
jenkins_pipeline_builder-1.10.0 lib/jenkins_pipeline_builder/custom_errors.rb
jenkins_pipeline_builder-1.9.1 lib/jenkins_pipeline_builder/custom_errors.rb
jenkins_pipeline_builder-1.9.0 lib/jenkins_pipeline_builder/custom_errors.rb
jenkins_pipeline_builder-1.8.0 lib/jenkins_pipeline_builder/custom_errors.rb
jenkins_pipeline_builder-1.7.0 lib/jenkins_pipeline_builder/custom_errors.rb
jenkins_pipeline_builder-1.5.0 lib/jenkins_pipeline_builder/custom_errors.rb
jenkins_pipeline_builder-1.3.0 lib/jenkins_pipeline_builder/custom_errors.rb
jenkins_pipeline_builder-1.2.1 lib/jenkins_pipeline_builder/custom_errors.rb
jenkins_pipeline_builder-1.2.0 lib/jenkins_pipeline_builder/custom_errors.rb
jenkins_pipeline_builder-1.1.5 lib/jenkins_pipeline_builder/custom_errors.rb
jenkins_pipeline_builder-1.1.4 lib/jenkins_pipeline_builder/custom_errors.rb
jenkins_pipeline_builder-1.1.3 lib/jenkins_pipeline_builder/custom_errors.rb
jenkins_pipeline_builder-1.1.2 lib/jenkins_pipeline_builder/custom_errors.rb
jenkins_pipeline_builder-1.1.0 lib/jenkins_pipeline_builder/custom_errors.rb
jenkins_pipeline_builder-1.0.0 lib/jenkins_pipeline_builder/custom_errors.rb
jenkins_pipeline_builder-0.16.3 lib/jenkins_pipeline_builder/custom_errors.rb
jenkins_pipeline_builder-0.16.2 lib/jenkins_pipeline_builder/custom_errors.rb
jenkins_pipeline_builder-0.16.0 lib/jenkins_pipeline_builder/custom_errors.rb