Exception: Errors::PerforceProblem

Inherits:
Exception
  • Object
show all
Defined in:
lib/errors/perforce_problem.rb

Overview

It's likely that many 'unknown server errors' are actually errors from the Perforce server. This exception allows your client code to inspect the returned information to potentially handle issues the API code was unable to deal with. This can happen in cases of funky Perforce server configurations.

Expect at least one message describing the problem. Each message contains 3 attributes: 'MessageCode', 'MessageSeverity', and 'MessageText'. You probably should only use the message code for any error handling logic, reserving the other fields for diagnostic usage.

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (PerforceProblem) initialize(messages)

Returns a new instance of PerforceProblem



15
16
17
# File 'lib/errors/perforce_problem.rb', line 15

def initialize(messages)
  @messages = messages
end

Instance Attribute Details

- (Object) messages

Returns the value of attribute messages



13
14
15
# File 'lib/errors/perforce_problem.rb', line 13

def messages
  @messages
end

Instance Method Details

- (Object) to_s



19
20
21
# File 'lib/errors/perforce_problem.rb', line 19

def to_s
  "PerforceProblem<@messages:[#{@messages}]>"
end