nowa-top4r 0.0.8 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -72,10 +72,17 @@ class Top4R::Client
72
72
  end
73
73
 
74
74
  map = JSON.parse(response.body)
75
- raise Top4R::RESTError.new(:code => map["error_rsp"]["code"],
75
+ if map["error_rsp"].is_a?(Hash) and map["error_rsp"]["code"].to_s == "630"
76
+ raise Top4R::SuiteNotOrderedError.new(:code => map["error_rsp"]["code"],
77
+ :message => map["error_rsp"]["msg"],
78
+ :error => map["error_rsp"],
79
+ :uri => uri)
80
+ else
81
+ raise Top4R::RESTError.new(:code => map["error_rsp"]["code"],
76
82
  :message => map["error_rsp"]["msg"],
77
83
  :error => map["error_rsp"],
78
- :uri => uri) if map["error_rsp"].is_a?(Hash)
84
+ :uri => uri)
85
+ end
79
86
  end
80
87
 
81
88
  def create_http_connection
data/lib/top4r/core.rb CHANGED
@@ -45,6 +45,12 @@ module Top4R
45
45
  end
46
46
  end # RESTError
47
47
 
48
+ class SuiteNotOrderedError < RESTError
49
+ def to_s
50
+ "错误代号#{@code},您没有订购该服务!"
51
+ end
52
+ end
53
+
48
54
  class LoginRequiredError < RuntimeError
49
55
  include ClassUtilMixin
50
56
  @@ATTRIBUTES = [:model, :method]
data/lib/top4r/version.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  module Top4R::Version
2
2
  MAJOR = 0
3
3
  MINOR = 0
4
- REVISION = 8
4
+ REVISION = 9
5
5
 
6
6
  class << self
7
7
  # Returns X.Y.Z formatted version string
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nowa-top4r
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nowa Zhu