web_function 0.3.0 → 0.3.2

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: 1a2ee660581b58f9c6c0d5596a134fe043a02d3a1f1399cf328016c6d6bab5df
4
- data.tar.gz: 617a6485865f6377cb87ae7419a66053fe54328f948543bc1b7bfbdecb15e8d6
3
+ metadata.gz: 651453280b0a98140477f0546132fe12d8d3019b7d4d2d70e7ab35151e64ba7a
4
+ data.tar.gz: 655a1615c48658c5e21738a8c88ea8c2a65916fd1edf54087d6fd39ec3e7402f
5
5
  SHA512:
6
- metadata.gz: df4b344637074682b2a56c8d996f3c71a57b57ea22e8683a5a0755c5c0dcdbcdf288a7c62f9e7a9fa522ae58e1a628ecf5f1c395c0d516d3a59cbdcb2d7a7f4d
7
- data.tar.gz: d4c0eb92ff33a8957981493804e9def5163335ff7fffd886e03c1fe9d5129de1da39237fa51eee6ac0cff142c024b076c4ddd6b62adf7e952cea7e515b6795a5
6
+ metadata.gz: d9d4d809aae59eb372f2c803ae14c0bb9396b7fb9e333af8a17773dc7b211981c3169f3da2f0762998825618e198afc6b172b4edad2c097a15fbe70dd09e71b5
7
+ data.tar.gz: a51eceeb6e007aec231e4ab201bd4164d6c0e618ee1c268f6f4b4c200593dd887694d534de52350af7d5fcb091bfa19f16be5922b6ec46a141357b756bdca314
@@ -10,6 +10,7 @@ module WebFunction
10
10
  headers = {
11
11
  "Content-Type": "application/json",
12
12
  "Accept": "application/json",
13
+ "User-Agent": "webfunction/#{WebFunction::VERSION}",
13
14
  }
14
15
 
15
16
  if bearer_auth
@@ -43,10 +44,12 @@ module WebFunction
43
44
  end
44
45
 
45
46
  if response.status != 200
46
- raise WebFunction::Error.new("Something went wrong, unexpected status code [#{response.status}]")
47
+ raise WebFunction::Error.new("Unexpected status code [#{response.status}]")
47
48
  end
48
49
 
49
50
  result
51
+ rescue JSON::ParserError => e
52
+ raise WebFunction::Error.new("Response cannot be parsed", details: {})
50
53
  end
51
54
 
52
55
  def name
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WebFunction
4
- VERSION = "0.3.0"
4
+ VERSION = "0.3.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: web_function
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robin Clart
@@ -86,7 +86,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
86
86
  - !ruby/object:Gem::Version
87
87
  version: '0'
88
88
  requirements: []
89
- rubygems_version: 3.6.9
89
+ rubygems_version: 3.7.1
90
90
  specification_version: 4
91
91
  summary: A Web Function Client for Ruby
92
92
  test_files: []