blob: 9971194d0eca50a1d8814f9f3b8938fcb6eb71f4 [file] [log] [blame]
Scott Baker2c1c4822019-10-16 11:02:41 -07001package ndr
2
3import "fmt"
4
5// Malformed implements the error interface for malformed NDR encoding errors.
6type Malformed struct {
7 EText string
8}
9
10// Error implements the error interface on the Malformed struct.
11func (e Malformed) Error() string {
12 return fmt.Sprintf("malformed NDR stream: %s", e.EText)
13}
14
15// Errorf formats an error message into a malformed NDR error.
16func Errorf(format string, a ...interface{}) Malformed {
17 return Malformed{EText: fmt.Sprintf(format, a...)}
18}