dingtalk-ruby 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/dingtalk.rb +7 -0
- data/lib/dingtalk/api/Base.rb +6 -6
- data/lib/dingtalk/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 811c636643cfe68d5b23b1f933630f0a33ccb5405435e9cedd01abf66f77d8a7
|
4
|
+
data.tar.gz: 944ecf610a8dab70698c7fab8d7e28c5a3153bf8e5106c81cb12c7224f293a07
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 12e0dd15a6f4d1f4b16378d728173b5f7c1b6235f6c20ce8d9607f7874aa2a5928cf4022a42a84c1bc70c0794c3f30a6615375d685d9addcc0b06e219567bf26
|
7
|
+
data.tar.gz: 72faf32c95c741199d2e971c16aabc7061ebe1e612cd450f02c0847599de52e1f9f3fa91315e5644a7f43a2a4c20d1a52a6e0a8104a8be93d91666677862aa37
|
data/Gemfile.lock
CHANGED
data/lib/dingtalk.rb
CHANGED
@@ -5,6 +5,13 @@ require "dingtalk/api/Base"
|
|
5
5
|
module Dingtalk
|
6
6
|
class Error < StandardError; end
|
7
7
|
class RequestException < RuntimeError; end
|
8
|
+
class TopException < RuntimeError
|
9
|
+
attr_accessor :errcode, :errmsg, :application_host, :service_host
|
10
|
+
|
11
|
+
def to_s
|
12
|
+
"\nerrcode= #{@errcode}\nerrmsg=#{@errmsg}\napplication_host=#{@application_host}\nservice_host=#{@service_host}"
|
13
|
+
end
|
14
|
+
end
|
8
15
|
|
9
16
|
class << self
|
10
17
|
attr_accessor :configuration
|
data/lib/dingtalk/api/Base.rb
CHANGED
@@ -124,12 +124,12 @@ module Dingtalk
|
|
124
124
|
# puts "result:", result
|
125
125
|
jsonobj = JSON.parse(result)
|
126
126
|
if jsonobj.key?(P_CODE) && (jsonobj[P_CODE] != 0)
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
raise
|
127
|
+
error = TopException.new
|
128
|
+
error.errcode = jsonobj[P_CODE]
|
129
|
+
error.errmsg = jsonobj[P_MSG]
|
130
|
+
error.application_host = response.headers.fetch("Application-Host", "")
|
131
|
+
error.service_host = response.headers.fetch("Location-Host", "")
|
132
|
+
raise error, "TopException"
|
133
133
|
end
|
134
134
|
|
135
135
|
jsonobj
|
data/lib/dingtalk/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dingtalk-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Zhenyuan Lau
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-12-
|
11
|
+
date: 2019-12-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|