Module: AethernalAgent::Errors

Included in:
Apache, App, Template
Defined in:
lib/aethernal_agent/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#global_errorsObject

Returns the value of attribute global_errors.



3
4
5
# File 'lib/aethernal_agent/errors.rb', line 3

def global_errors
  @global_errors
end

Instance Method Details

#add_errors(error, vars = {}) ⇒ Object



5
6
7
8
9
# File 'lib/aethernal_agent/errors.rb', line 5

def add_errors(error, vars = {})
  AethernalAgent.logger.debug("Adding errors: '#{error}'")
  self.global_errors ||=[]
  self.global_errors << {method: caller_locations(2,1)[0].label, error: error, args: vars}
end

#get_errorsObject



11
12
13
14
15
# File 'lib/aethernal_agent/errors.rb', line 11

def get_errors
  errors = self.global_errors
  self.global_errors = []
  return errors
end