Class: Aliyun::Opensearch::Error::AliyunService
- Defined in:
- lib/aliyun/opensearch/error.rb
Overview
阿里云异常基类
Constant Summary collapse
- ERRCODE_ALIYUN_SYS =
系统级别(1000-1999)
(1000..1999).freeze
- ERRCODE_ALIYUN_APP =
应用相关(2000-2999)
(2000..2999).freeze
- ERRCODE_ALIYUN_DOC =
文档相关(3000-3999)
(3000..3999).freeze
- ERRCODE_ALIYUN_AUTH =
授权相关(4000-4999)
(4000..4999).freeze
- ERRCODE_ALIYUN_USER =
用户相关(5000-5999)
(5000..5999).freeze
- ERRCODE_ALIYUN_SEARCH =
搜索相关(6000-6999)
(6000..6999).freeze
- ERRCODE_ALIYUN_CMD =
数据处理相关(7000-7999)
(7000..7999).freeze
- ERRCODE_ALIYUN_COMMON =
文档错误内部通知(8000-8999)
(8000..8999).freeze
- ERRCODE_ALIYUN_TEMPLETE =
模板相关(9000-9999)
(9000..9999).freeze
- ERRCODE_ALIYUN_SYNC =
数据同步相关(10000-)
(10_000..).freeze
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
-
#errors_message ⇒ String
获取错误信息.
-
#initialize(response) ⇒ AliyunService
constructor
初始化.
Constructor Details
#initialize(response) ⇒ AliyunService
初始化
45 46 47 48 49 50 |
# File 'lib/aliyun/opensearch/error.rb', line 45 def initialize(response) @response = response @body = JSON.parse(response.body) super("RequestId:#{@body['request_id']} Message:#{}", response) end |
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
36 37 38 |
# File 'lib/aliyun/opensearch/error.rb', line 36 def response @response end |
Instance Method Details
#errors_message ⇒ String
获取错误信息
59 60 61 62 63 |
# File 'lib/aliyun/opensearch/error.rb', line 59 def @body['errors'].map do |error| "[#{error['code']}] #{error['message']}" end.join("\n") end |