Skip to content

Commit 3a7986f

Browse files
committed
rfqmsg: add reject-with-custom-message utility
ErrRejectWithCustomMsg constructs a RejectErr with error code 0 and the specified error message.
1 parent 8ff0ae9 commit 3a7986f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

rfqmsg/reject.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,15 @@ var (
9292
}
9393
)
9494

95+
// ErrRejectWithCustomMsg produces the "unknown" error code, but pairs
96+
// it with a custom error message.
97+
func ErrRejectWithCustomMsg(msg string) RejectErr {
98+
return RejectErr{
99+
Code: 0,
100+
Msg: msg,
101+
}
102+
}
103+
95104
const (
96105
// latestRejectVersion is the latest supported reject wire message data
97106
// field version.

0 commit comments

Comments
 (0)