Module: PactBroker::Errors

Defined in:
lib/pact_broker/errors.rb,
lib/pact_broker/errors/error_logger.rb,
lib/pact_broker/errors/error_reporter.rb

Defined Under Namespace

Classes: ErrorLogger, ErrorReporter

Class Method Summary collapse

Class Method Details

.generate_error_referenceObject



5
6
7
# File 'lib/pact_broker/errors.rb', line 5

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

.reportable_error?(error) ⇒ Boolean

Return true if the error is one that should be reported to an external bug tracking system

Returns:

  • (Boolean)


11
12
13
# File 'lib/pact_broker/errors.rb', line 11

def self.reportable_error?(error)
  error.is_a?(PactBroker::TestError) || (!error.is_a?(PactBroker::Error) && !error.is_a?(JSON::JSONError))
end