epics 1.8.0 → 1.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/epics/error.rb +0 -1
- data/lib/epics/middleware/parse_ebics.rb +2 -6
- data/lib/epics/version.rb +1 -1
- data/spec/middleware/parse_ebics_spec.rb +4 -8
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1d010ef17cbdb364881aa1d097aa37aa5d5dcbe10475042a48c2fdbff7f06bbd
|
4
|
+
data.tar.gz: 9344c72519ee202a8b919ee1995d6784063767bf5b486f43e4f69fe1866c4099
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9fea543b7b03303a272a67499f1c79b60e574c58fc43e9843f11100ca92f8311869c89904f3b1d3a7507fd579380b846d81752b25a488a4969d5548b5820b070
|
7
|
+
data.tar.gz: 6f8df9fe023baee3c6f6d292a9ba1df6a77af88da38a4b93323c7a8c2adb8199e9554bac8920a87eb33670f698d1c3c0a8911b15eed9d9a9741863b776ac80e2
|
data/CHANGELOG.md
CHANGED
data/lib/epics/error.rb
CHANGED
@@ -9,12 +9,8 @@ class Epics::ParseEbics < Faraday::Middleware
|
|
9
9
|
def call(env)
|
10
10
|
@app.call(env).on_complete do |response|
|
11
11
|
response.body = ::Epics::Response.new(@client, response.body)
|
12
|
-
raise
|
13
|
-
raise
|
12
|
+
raise(Epics::Error::TechnicalError, response.body.technical_code) if response.body.technical_error?
|
13
|
+
raise(Epics::Error::BusinessError, response.body.business_code) if response.body.business_error?
|
14
14
|
end
|
15
|
-
rescue Epics::Error::TechnicalError, Epics::Error::BusinessError
|
16
|
-
raise # re-raise as otherwise they would be swallowed by the following rescue
|
17
|
-
rescue StandardError => e
|
18
|
-
raise Epics::Error::UnknownError, e
|
19
15
|
end
|
20
16
|
end
|
data/lib/epics/version.rb
CHANGED
@@ -23,17 +23,13 @@ RSpec.describe Epics::ParseEbics do
|
|
23
23
|
expect(subject.post('/ok').body).to be_kind_of(Epics::Response)
|
24
24
|
end
|
25
25
|
|
26
|
-
it 'will handle a timeout with raising an Epics::Error::TechnicalError' do
|
27
|
-
expect { subject.post('/timeout') }.to raise_error(Epics::Error::UnknownError, 'timeout')
|
28
|
-
end
|
29
|
-
|
30
26
|
context 'failures' do
|
31
|
-
it 'will
|
32
|
-
expect { subject.post('/timeout') }.to raise_error(
|
27
|
+
it 'will raise a timeout correctly' do
|
28
|
+
expect { subject.post('/timeout') }.to raise_error(Faraday::TimeoutError, 'timeout')
|
33
29
|
end
|
34
30
|
|
35
|
-
it 'will
|
36
|
-
expect { subject.post('/no_connection') }.to raise_error(
|
31
|
+
it 'will properly raise non-epics errors' do
|
32
|
+
expect { subject.post('/no_connection') }.to raise_error(Faraday::ConnectionFailed, 'peer has finished all lan parties and gone home')
|
37
33
|
end
|
38
34
|
end
|
39
35
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: epics
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.8.
|
4
|
+
version: 1.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lars Brillert
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-07-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -305,7 +305,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
305
305
|
- !ruby/object:Gem::Version
|
306
306
|
version: '0'
|
307
307
|
requirements: []
|
308
|
-
rubygems_version: 3.0.
|
308
|
+
rubygems_version: 3.0.8
|
309
309
|
signing_key:
|
310
310
|
specification_version: 4
|
311
311
|
summary: a ruby implementation of the EBICS protocol
|