File tree 3 files changed +38
-43
lines changed
3 files changed +38
-43
lines changed Original file line number Diff line number Diff line change 1
1
package epp
2
2
3
- import (
4
- "errors"
5
- )
3
+ // Error is the interface implemented by all errors in this package.
4
+ type Error interface {
5
+ eppError ()
6
+ }
7
+
8
+ type stringError string
9
+
10
+ func (stringError ) eppError () {}
11
+
12
+ func (s stringError ) Error () string {
13
+ return "epp: " + string (s )
14
+ }
15
+
16
+ // ErrClosedConnection indicates a read or write operation on a closed connection.
17
+ const ErrClosedConnection stringError = "operation on closed connection"
6
18
7
19
// ErrServerClosed indicates a [Server] has shut down or closed.
8
- var ErrServerClosed = errors .New ("epp: server closed" )
20
+ const ErrServerClosed stringError = "server closed"
21
+
22
+ // TransactionIDError indicates an invalid transaction ID.
23
+ type TransactionIDError struct {
24
+ TransactionID string
25
+ }
26
+
27
+ func (TransactionIDError ) eppError () {}
28
+
29
+ // Error implements the error interface.
30
+ func (err TransactionIDError ) Error () string {
31
+ return "epp: invalid transaction transaction ID: " + err .TransactionID
32
+ }
33
+
34
+ // DuplicateTransactionIDError indicates a duplicate transaction ID.
35
+ type DuplicateTransactionIDError TransactionIDError
36
+
37
+ func (DuplicateTransactionIDError ) eppError () {}
38
+
39
+ // Error implements the error interface.
40
+ func (err DuplicateTransactionIDError ) Error () string {
41
+ return "epp: duplicate transaction ID: " + err .TransactionID
42
+ }
Load Diff This file was deleted.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments