hbci 0.3.3 → 0.3.4

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
  SHA256:
3
- metadata.gz: 9e91e6b53c57264ef649f0b52e2aa02f2467d961d18bd58758251eaed3129812
4
- data.tar.gz: abcf6bab84ca13957b4c121272a8fea6bcf98bb7e81bfa8a1df2c0abf4f87f2c
3
+ metadata.gz: 51e1df58bd9259aaf5c3eec44ef38794490c6de86082fc22181c00515fd32277
4
+ data.tar.gz: ca7b6c0660ea957e22c2e6d80296135df087809653307f5abe6b3765d4f777ee
5
5
  SHA512:
6
- metadata.gz: cef82b1b29d2e5abd18dc9d0ba80fcdebffe98048d7ebfcf1a10f97e736e9534062261a8063ceedfd53f9f6d1629ce7fe56f7cae9ea1417da7ed9ae2dcad0d09
7
- data.tar.gz: 131d3c074f31573d7f3693e5499563f3585665c27127e35e685534113725e179f870922a866c67a7e7068c638bfd97295a6878baf8099de0d94e88752aae3223
6
+ metadata.gz: 681b6de4ea4c7e3326eb245ff1ca202f1004d7ab5ca5a1a65f869eeb89fedf478aaa38be30fcf033669f572c8f827507c04f4f5749e90c039e196cd4c4b8fe74
7
+ data.tar.gz: 4f2d2a6a2fcf191c71662b4b35b75506d7c1eff669223a66d3d7044dbe252fcd5bdadf12d1900c926558fe5adcca10312e8f6dc928be41ecbd503be1f6c70b42
@@ -21,6 +21,11 @@ require 'hbci/element_unparser'
21
21
  require 'hbci/connector'
22
22
  require 'hbci/message_factory'
23
23
 
24
+ # Errors
25
+ require 'hbci/errors/hbci/base_error'
26
+ require 'hbci/errors/hbci/dialog_error'
27
+ require 'hbci/errors/hbci/service_unavailable'
28
+
24
29
  # Element groups
25
30
  require 'hbci/element_group'
26
31
  require 'hbci/element_groups/segment_head'
@@ -43,7 +43,7 @@ module Hbci
43
43
 
44
44
  @response = Response.new(@connector.post(request_message))
45
45
 
46
- raise @response.to_s unless initialization_successful?
46
+ raise DialogError.new('Initialization failed', @response.to_s) unless initialization_successful?
47
47
 
48
48
  @id = @response.find('HNHBK').dialog_id
49
49
  @tan_mechanism = @response.find('HNVSD').find('HIRMS').allowed_tan_mechanism
@@ -0,0 +1,4 @@
1
+ module Hbci
2
+ class BaseError < StandardError
3
+ end
4
+ end
@@ -0,0 +1,10 @@
1
+ module Hbci
2
+ class DialogError < BaseError
3
+ attr_reader :hbci_response
4
+
5
+ def initialize(msg, hbci_response = nil)
6
+ super(msg)
7
+ @hbci_response = hbci_response
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,4 @@
1
+ module Hbci
2
+ class ServiceUnavailable < BaseError
3
+ end
4
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Hbci
4
- VERSION = '0.3.3'
4
+ VERSION = '0.3.4'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hbci
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roman Lehnert
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-01-29 00:00:00.000000000 Z
12
+ date: 2019-02-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bank_credentials
@@ -252,6 +252,9 @@ files:
252
252
  - lib/hbci/element_groups/segment_head.rb
253
253
  - lib/hbci/element_groups/unknown.rb
254
254
  - lib/hbci/element_unparser.rb
255
+ - lib/hbci/errors/hbci/base_error.rb
256
+ - lib/hbci/errors/hbci/dialog_error.rb
257
+ - lib/hbci/errors/hbci/service_unavailable.rb
255
258
  - lib/hbci/message.rb
256
259
  - lib/hbci/message_factory.rb
257
260
  - lib/hbci/parser.rb