Exception: ZabbixManager::BaseError

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/zabbix_manager/classes/errors.rb

Overview

BaseError 是 ZabbixManager 模块中处理异常的基类

Direct Known Subclasses

HttpError, ZbxError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, response = nil) ⇒ BaseError

初始化异常对象



14
15
16
17
18
# File 'lib/zabbix_manager/classes/errors.rb', line 14

def initialize(message, response = nil)
  super(message)
  @response = response
  set_error! if @response
end

Instance Attribute Details

#errorObject

用于存储 Zabbix API 错误信息



9
10
11
# File 'lib/zabbix_manager/classes/errors.rb', line 9

def error
  @error
end

#error_messageObject

用于存储格式化后的错误消息



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

def error_message
  @error_message
end

#responseObject

用于存储响应对象



7
8
9
# File 'lib/zabbix_manager/classes/errors.rb', line 7

def response
  @response
end