-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patherrors.go
42 lines (30 loc) · 1.15 KB
/
errors.go
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
package epp
// Error is the interface implemented by all errors in this package.
type Error interface {
eppError()
}
type stringError string
func (stringError) eppError() {}
func (s stringError) Error() string {
return "epp: " + string(s)
}
// ErrClosedConnection indicates a read or write operation on a closed connection.
const ErrClosedConnection stringError = "operation on closed connection"
// ErrServerClosed indicates a [Server] has shut down or closed.
const ErrServerClosed stringError = "server closed"
// TransactionIDError indicates an invalid transaction ID.
type TransactionIDError struct {
TransactionID string
}
func (TransactionIDError) eppError() {}
// Error implements the error interface.
func (err TransactionIDError) Error() string {
return "epp: invalid transaction transaction ID: " + err.TransactionID
}
// DuplicateTransactionIDError indicates a duplicate transaction ID.
type DuplicateTransactionIDError TransactionIDError
func (DuplicateTransactionIDError) eppError() {}
// Error implements the error interface.
func (err DuplicateTransactionIDError) Error() string {
return "epp: duplicate transaction ID: " + err.TransactionID
}