Sha256: 6a2733354d82a8361f239564f9c2c12f3501201231e807a3c848e5c3d15d18e5

Contents?: true

Size: 453 Bytes

Versions: 5

Compression:

Stored size: 453 Bytes

Contents

require "securerandom"

module PactBroker
  module Errors
    def self.generate_error_reference
      SecureRandom.urlsafe_base64.gsub(/[^a-z]/i, "")[0,10]
    end

    # Return true if the error is one that should be reported to an external bug tracking system
    # @return [Boolean]
    def self.reportable_error?(error)
      error.is_a?(PactBroker::TestError) || (!error.is_a?(PactBroker::Error) && !error.is_a?(JSON::JSONError))
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
pact_broker-2.112.0 lib/pact_broker/errors.rb
pact_broker-2.111.0 lib/pact_broker/errors.rb
pact_broker-2.109.1 lib/pact_broker/errors.rb
pact_broker-2.109.0 lib/pact_broker/errors.rb
pact_broker-2.108.0 lib/pact_broker/errors.rb