kounta_rest 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.
@@ -5,6 +5,7 @@ module Kounta
5
5
  property :people_id
6
6
  property :first_name
7
7
  property :last_name
8
+ property :email
8
9
  property :primary_email_address
9
10
  property :description
10
11
  property :email_addresses
data/lib/kounta/errors.rb CHANGED
@@ -3,5 +3,6 @@ module Kounta
3
3
  class KountaError < StandardError; end
4
4
  class MissingOauthDetails < KountaError; end
5
5
  class UnknownResourceAttribute < KountaError; end
6
+ class APIError < KountaError; end
6
7
  end
7
8
  end
@@ -30,20 +30,16 @@ module Kounta
30
30
  response = @conn.request(request_method, "#{path_from_hash(url_hash)}.#{FORMAT.to_s}", options)
31
31
  rescue OAuth2::Error => ex
32
32
  if ex.message.include? 'The access token provided has expired'
33
- log('oauth2 token expired, refreshing it...')
33
+ log(ex.message)
34
34
  @conn = refreshed_token
35
35
  retry
36
36
  end
37
+ raise Kounta::Errors::APIError.new(ex.message)
37
38
  end
38
-
39
- log("response:")
40
39
 
41
40
  if response
42
- log("#{response.parsed}")
41
+ log("Response: #{response.parsed}")
43
42
  response.parsed
44
- else
45
- log('No response recieved')
46
- nil
47
43
  end
48
44
  end
49
45
 
@@ -1,3 +1,3 @@
1
1
  module Kounta
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kounta_rest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-11-07 00:00:00.000000000 Z
12
+ date: 2013-11-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler