hotcell-client 1.0.0 → 1.1.0

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: 3f042fb2051305fb95fd1105d957c8b3fef5f11ae5f878a1b7aa2b8fd2938f51
4
- data.tar.gz: '0558499bc9de4db83b29fa2cd944c8717727adf0bb183b19f8bf8b3a6943a91c'
3
+ metadata.gz: 1ba1bb0047670fef637ea304c58ca6589c68c68491b84df357745f4c35dba740
4
+ data.tar.gz: ec3e1cac68b95f6af2c00982538ce95a19a1257014c1c8bec53a49a860e68f83
5
5
  SHA512:
6
- metadata.gz: ed83acbcf70109076babfd88a0930d01097da8e7dc5b71bd20a70e76bff0432d65a5a8766c29af82f6310d546a0519fa2f82310195625fda497a6390bb7d7bfa
7
- data.tar.gz: 9a63c9612e6ee701612af06b99421376294419a307d10f6c7b515a4a1f63348a4fa4d25df3221ac65b2d5ea44c4ef832a955525c856f6d75789f0279730a3774
6
+ metadata.gz: 26eaf78d5f835becb66508a423f91f73223e843d531e6d44723c5d635f9cab1b16f7560f58fc322ab25b50c6503d6d6227d88665a0ca2f81533de19e16f3b84d
7
+ data.tar.gz: e12b678e13d8327c502ae440e923970dd7bcd32b1e828ba9d1ffedabbf724e678c6d36a63bf412d50b289be46c513698f62af187d4a35a6ee13a8d573bfe16a5
@@ -3,6 +3,6 @@
3
3
  module HotCell
4
4
  # A class and not a module: this file loads before hot_cell/client.rb opens the same name.
5
5
  class Client
6
- VERSION = "1.0.0"
6
+ VERSION = "1.1.0"
7
7
  end
8
8
  end
@@ -200,7 +200,7 @@ module HotCell
200
200
  return if response.ok?
201
201
 
202
202
  failure = response.failure
203
- error = cell.exception_for(failure).new(failure.to_s)
203
+ error = Verdict.wrap(cell.exception_for(failure).new(failure.to_s), failure)
204
204
  cell.report_contract_skew error if failure.code == "protocol"
205
205
 
206
206
  raise error
@@ -21,4 +21,17 @@ module HotCell
21
21
  # classification, so a later tidying pass that gives both a common ancestor silently turns every retryable
22
22
  # failure into a permanent one.
23
23
  class TransientFailure < StandardError; end
24
+
25
+ # Extended onto every exception the client raises, so an application can read the failure's code,
26
+ # cause and permanence without parsing the message — and rescue HotCell::Verdict itself, whatever
27
+ # classes the registration injected.
28
+ module Verdict
29
+ attr_reader :hot_cell_failure
30
+
31
+ def self.wrap(error, failure)
32
+ error.extend(self)
33
+ error.instance_variable_set(:@hot_cell_failure, failure)
34
+ error
35
+ end
36
+ end
24
37
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hotcell-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Dalessio
@@ -15,14 +15,14 @@ dependencies:
15
15
  requirements:
16
16
  - - '='
17
17
  - !ruby/object:Gem::Version
18
- version: 1.0.0
18
+ version: 1.1.0
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - '='
24
24
  - !ruby/object:Gem::Version
25
- version: 1.0.0
25
+ version: 1.1.0
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: activesupport
28
28
  requirement: !ruby/object:Gem::Requirement
@@ -71,8 +71,8 @@ licenses:
71
71
  - MIT
72
72
  metadata:
73
73
  homepage_uri: https://github.com/basecamp/hotcell
74
- source_code_uri: https://github.com/basecamp/hotcell/tree/v1.0.0/hotcell-client
75
- changelog_uri: https://github.com/basecamp/hotcell/blob/v1.0.0/CHANGELOG.md
74
+ source_code_uri: https://github.com/basecamp/hotcell/tree/v1.1.0/hotcell-client
75
+ changelog_uri: https://github.com/basecamp/hotcell/blob/v1.1.0/CHANGELOG.md
76
76
  documentation_uri: https://basecamp.github.io/hotcell/
77
77
  bug_tracker_uri: https://github.com/basecamp/hotcell/issues
78
78
  rubygems_mfa_required: 'true'
@@ -90,7 +90,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
90
90
  - !ruby/object:Gem::Version
91
91
  version: '0'
92
92
  requirements: []
93
- rubygems_version: 4.0.6
93
+ rubygems_version: 4.0.16
94
94
  specification_version: 4
95
95
  summary: Call a HotCell from an application.
96
96
  test_files: []