determinator 0.9.1 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0a7faec5d84de6789a94db7db9ff1de4fe22f947
4
- data.tar.gz: 7c6f139261beea20a8f5c64f5071582a2314e4f1
3
+ metadata.gz: ecd2a7d802e9ad2562fbdf9708ff34a84242b91e
4
+ data.tar.gz: 5b1918806a440a52f4c337286164b79376059fef
5
5
  SHA512:
6
- metadata.gz: cda841470760af3175a63d5d6e4a464bce9b71f6c3df6953e140fbae31dd8b1c6cdeae89504e71ac66dab8298b364c0eab641cca6cc98e39ed915e626ac7dd06
7
- data.tar.gz: e3a5d769418dc6be72b97df333f8feafbb662fcb78331381863c6cb21193ad5d4b67d68c1b2bf0f513b660347f0676ec02f122f674cd821d4b44c29886eb6a04
6
+ metadata.gz: f1a2cf800a27d2b5bf007d50507bc8a1394c596cc0563b4b73fa6cb5dabe3ea43f8558b64840df9baad51ed571c2837409f20aef17e3a5ac4c895264326bb56f
7
+ data.tar.gz: 64035bfedb2ed42cb72f27bf48cc09d875a1764f5ecec945f8a409a95c8aab09ac66893b0ef9432d4852689093ccc1c3d137e248285e00dfc27826d0479f4116
@@ -1,3 +1,8 @@
1
+ # v0.10.0 (2017-09-15)
2
+
3
+ Feature:
4
+ - Determinator can now be configured to log errors with any external service (#32)
5
+
1
6
  # v0.9.1 (2017-09-14)
2
7
 
3
8
  Bug fix:
data/README.md CHANGED
@@ -55,7 +55,8 @@ Determinator.configure(
55
55
  retrieval: Determinator::Retrieve::Routemaster.new(
56
56
  discovery_url: 'https://florence.dev/'
57
57
  retrieval_cache: ActiveSupport::Cache::MemoryStore.new(expires_in: 1.minute)
58
- )
58
+ ),
59
+ errors: -> error { NewRelic::Agent.notice_error(error) }
59
60
  )
60
61
  ```
61
62
 
@@ -5,4 +5,6 @@ Determinator.configure(
5
5
  discovery_url: 'https://florence.dev/'
6
6
  retrieval_cache: ActiveSupport::Cache::MemoryStore.new(expires_in: 1.minute)
7
7
  )
8
+ # The following would allow tracking of errors in NewRelic
9
+ # errors: -> error { NewRelic::Agent.notice_error(error) }
8
10
  )
@@ -6,7 +6,10 @@ require 'determinator/retrieve/routemaster'
6
6
  require 'determinator/retrieve/null_retriever'
7
7
 
8
8
  module Determinator
9
- def self.configure(retrieval:)
9
+ # @param :retrieval [Determinator::Retrieve::Routemaster] A retrieval instance for Features
10
+ # @param :errors [Proc, nil] a proc, accepting an error, which will be called with any errors which occur while determinating
11
+ def self.configure(retrieval:, errors: nil)
12
+ @error_logger = errors if errors.respond_to?(:call)
10
13
  @instance = Control.new(retrieval: retrieval)
11
14
  end
12
15
 
@@ -14,4 +17,10 @@ module Determinator
14
17
  raise "No singleton Determinator instance defined" unless @instance
15
18
  @instance
16
19
  end
20
+
21
+ def self.notice_error(error)
22
+ return unless @error_logger
23
+
24
+ @error_logger.call(error)
25
+ end
17
26
  end
@@ -31,7 +31,8 @@ module Determinator
31
31
  cached_feature_lookup(feature_id) do
32
32
  @actor_service.feature.show(feature_id)
33
33
  end
34
- rescue ::Routemaster::Errors::ResourceNotFound
34
+ rescue => e
35
+ Determinator.notice_error(e)
35
36
  nil
36
37
  end
37
38
 
@@ -1,3 +1,3 @@
1
1
  module Determinator
2
- VERSION = '0.9.1'
2
+ VERSION = '0.10.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: determinator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - JP Hastings-Spital
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-09-14 00:00:00.000000000 Z
11
+ date: 2017-09-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: routemaster-drain