ci_block_io 1.6.0 → 1.7.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f6560fed50f1495eba73cfb84738e3b5cdc454ca92336c7bda99046eb3bae01a
4
- data.tar.gz: 93101230893cc5bf106dbb03b9742d2bd941d370baf3b46bfcde99dd62eb152c
3
+ metadata.gz: 2abd2718e9c87fb33dc7aaecc59c39b475fd2d99c04738fb1f9334bd3e40c861
4
+ data.tar.gz: 47a1b5f23851a355378cd89f50e07ef2090585d60653037bee1fbcdf78619ddf
5
5
  SHA512:
6
- metadata.gz: dae77e55a5612a90446205f0585472c3923f64033a090a179d2a63bc090c959c06242038800c8e88edb11177d7f9c970d2900dbd1a25ee7be4d3a7dff5b63555
7
- data.tar.gz: 0d495b1f51ffab04711f9727bd97c3497279032faf425eff91b891f8c482490bc1bf4b2dfea57639314ff84c67ea3f14e9583fbbf3700d8bc00ae6662ca3b092
6
+ metadata.gz: ce7c50a375b4ec74ca6ff03714b23fe7cde4a30fb29739f392ecb8423345b989be3f08c7fc3cf552ed4bcb6269098b2b25f617e839b6504ef7d3bb98a8087174
7
+ data.tar.gz: e764bb64d1b075e8df6f6a360e952b82d0cb58786a05e6bfe4660e57e080d8c3cae15264a2b5b32914c618a43d82451d7a332170d9f3e249f3790281809394ef
@@ -1,3 +1,3 @@
1
1
  module CiBlockIo
2
- VERSION = "1.6.0"
2
+ VERSION = "1.7.0"
3
3
  end
data/lib/ci_block_io.rb CHANGED
@@ -8,7 +8,7 @@ require 'pbkdf2'
8
8
  require 'securerandom'
9
9
  require 'base64'
10
10
 
11
- class CiBlockIoWithdrawException < Exception
11
+ class CiBlockIoWithdrawException < StandardError
12
12
  end
13
13
 
14
14
  module CiBlockIo
@@ -148,7 +148,14 @@ module CiBlockIo
148
148
 
149
149
  begin
150
150
  body = Oj.load(response.body)
151
- raise Exception.new(body['data']['error_message']) if !body['status'].eql?('success')
151
+ return unless body['status'].eql?('success')
152
+ case endpoint[0]
153
+ when 'withdraw' then
154
+ raise CiBlockIoWithdrawException.new(body['data']['error_message'])
155
+ else
156
+ raise Exception.new(body['data']['error_message'])
157
+ end
158
+ end
152
159
  rescue
153
160
  raise Exception.new('Unknown error occurred. Please report this.')
154
161
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ci_block_io
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Atsuhiro Tsuruta feat. Atif Nazir
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-09-22 00:00:00.000000000 Z
11
+ date: 2018-09-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler