b2-client 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/b2.rb +1 -0
- data/lib/b2/connection.rb +12 -1
- data/lib/b2/errors.rb +9 -0
- data/lib/b2/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 90351edd9bc9e92242bf093a853d0ee2c9a2f2dc7bd5c6d5f9d4a11f966c7082
|
4
|
+
data.tar.gz: f244abd20dafe43ea6e1c259637ce6d8182d6595997e7148dc4e313128fafbf5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f8062646a787ed2d5fdd7b7d1ffe4ccd359f3dc4fed0f43f8210bae0c7d20dbcaa9cb552cb44b7a26a4160a9729d9dbf140276c8adf39f42f74c022f9ece3cc8
|
7
|
+
data.tar.gz: af4f4d63cb24311935f3fcb273b294c61597624ed15dca8def02ebffade49e618d549169bc0708421d005dca1fcebb9c58c7acd8da7e0f7ade326cee8ab8dbe1
|
data/lib/b2.rb
CHANGED
data/lib/b2/connection.rb
CHANGED
@@ -113,8 +113,19 @@ class B2
|
|
113
113
|
if digestor.hexdigest != response['X-Bz-Content-Sha1']
|
114
114
|
raise 'file error'
|
115
115
|
end
|
116
|
+
when Net::HTTPNotFound
|
117
|
+
raise B2::NotFound.new(JSON.parse(response.body)['message'])
|
116
118
|
else
|
117
|
-
|
119
|
+
begin
|
120
|
+
body = JSON.parse(response.body)
|
121
|
+
if body['code'] == 'not_found'
|
122
|
+
raise B2::NotFound(body['message'])
|
123
|
+
else
|
124
|
+
raise "#{body['code']} (#{body['message']})"
|
125
|
+
end
|
126
|
+
rescue
|
127
|
+
raise response.body
|
128
|
+
end
|
118
129
|
end
|
119
130
|
end
|
120
131
|
end
|
data/lib/b2/errors.rb
ADDED
data/lib/b2/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: b2-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jon Bracy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-11-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -39,6 +39,7 @@ files:
|
|
39
39
|
- lib/b2/bucket.rb
|
40
40
|
- lib/b2/client.rb
|
41
41
|
- lib/b2/connection.rb
|
42
|
+
- lib/b2/errors.rb
|
42
43
|
- lib/b2/file.rb
|
43
44
|
- lib/b2/upload_chunker.rb
|
44
45
|
- lib/b2/version.rb
|