europeana-api 0.4.2 → 0.4.3

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
  SHA1:
3
- metadata.gz: 315e0516f46893b2abffd0f4029886221288ccbf
4
- data.tar.gz: d4a57f6dfd044ac0e735da0f65388b32b58dee6d
3
+ metadata.gz: fed167ebe94821c373f6b8900d928272b77ac1b1
4
+ data.tar.gz: 4caaa829abfc8af7f7f3c9a3ae7e557b610ba260
5
5
  SHA512:
6
- metadata.gz: 7b9078d822cbb9bc845b7f0750e7014dfcafa0a53f60c5c8b71f0642bb94ead1c5c0f2cedbe5dc011cea4968d7df7f83ddb8a581d61f43164626903efb71fd33
7
- data.tar.gz: 79a6b2346c50480ace538b26addd310654db502d3e1e165cb15ce0cc405f48160ebd6dede865470e14d73233bf5ee7186d20e8b9aaa4c67c0d264db8ef3df373
6
+ metadata.gz: 2c76ccf7a83211c0e1fb1652c1481bd24e6b53806a7538f968b38cbc41fc48949e926852564e2439f784727c945c5c2f2f6934d1cdeeb7685b8cca959f9b49a5
7
+ data.tar.gz: f35b2ca4859c4f2fd77b50af490aa1fc9db4a4db43519e0e72a670a29e4fd0ff8efa89759ad195576dc8ab4bb125adb71d0d5459ae8202ea8c86978e6599a42a
@@ -3,6 +3,8 @@ module Europeana
3
3
  module Errors
4
4
  ##
5
5
  # Raised if API requests are attempted without the API key having been set.
6
+ #
7
+ # @todo Use one-line error messages (in backwards-incompatible version)
6
8
  class MissingAPIKeyError < StandardError
7
9
  def initialize(msg = nil)
8
10
  msg ||= <<-MSG
@@ -46,6 +48,14 @@ module Europeana
46
48
  super(msg)
47
49
  end
48
50
  end
51
+
52
+ module Request
53
+ ##
54
+ # Raised if the API response indicates invalid pagination params in
55
+ # the request.
56
+ class PaginationError < StandardError
57
+ end
58
+ end
49
59
  end
50
60
  end
51
61
  end
@@ -50,7 +50,12 @@ module Europeana
50
50
  def parse_response(response, _options = {})
51
51
  super.tap do |body|
52
52
  unless body[:success]
53
- fail Errors::RequestError, (body.key?(:error) ? body[:error] : response.code)
53
+ klass = if body.key?(:error) && body[:error] =~ /1000 search results/
54
+ Errors::Request::PaginationError
55
+ else
56
+ Errors::RequestError
57
+ end
58
+ fail klass, (body.key?(:error) ? body[:error] : response.code)
54
59
  end
55
60
  end
56
61
  end
@@ -2,6 +2,6 @@ module Europeana
2
2
  ##
3
3
  # Sets the *gem* version (not the *API* version)
4
4
  module API
5
- VERSION = '0.4.2'
5
+ VERSION = '0.4.3'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: europeana-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Doe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-14 00:00:00.000000000 Z
11
+ date: 2016-02-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport