Exception: Pione::Agent::TimeoutError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/pione/agent/agent-exception.rb

Overview

TimeoutError is raised when the agent is timeouted.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(agent, states, sec) ⇒ TimeoutError

Returns a new instance of TimeoutError.



21
22
23
24
25
# File 'lib/pione/agent/agent-exception.rb', line 21

def initialize(agent, states, sec)
  @agent = agent
  @states = states
  @sec = sec
end

Instance Attribute Details

#agentObject (readonly)

agent timeouted



17
18
19
# File 'lib/pione/agent/agent-exception.rb', line 17

def agent
  @agent
end

#agent_statesObject (readonly)

agent states



18
19
20
# File 'lib/pione/agent/agent-exception.rb', line 18

def agent_states
  @agent_states
end

#secObject (readonly)

timeout second



19
20
21
# File 'lib/pione/agent/agent-exception.rb', line 19

def sec
  @sec
end

Instance Method Details

#messageObject



27
28
29
30
# File 'lib/pione/agent/agent-exception.rb', line 27

def message
  sec = @sec ? "(%s sec)" % @sec : ""
  "%s timeouted %s at state [%s]" % [@agent, sec, @states.map{|s| s.to_s}.join(", ")]
end