-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy patherrors.rb
More file actions
45 lines (38 loc) · 1.04 KB
/
errors.rb
File metadata and controls
45 lines (38 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
class ::PiNetwork
module Errors
class APIRequestError < StandardError
attr_reader :response_body
attr_reader :response_status
def initialize(message, response_status, response_body)
super(message)
@response_status = response_status
@response_body = response_body
end
end
class PaymentNotFoundError < StandardError
attr_reader :payment_id
def initialize(message, payment_id)
super(message)
@payment_id = payment_id
end
end
class TxidAlreadyLinkedError < StandardError
attr_reader :payment_id
attr_reader :txid
def initialize(message, payment_id, txid)
super(message)
@payment_id = payment_id
@txid = txid
end
end
class TxSubmissionError < StandardError
attr_reader :tx_error_code
attr_reader :op_error_codes
def initialize(tx_error_code, op_error_codes)
super(message)
@tx_error_code = tx_error_code
@op_error_codes = op_error_codes
end
end
end
end