27 lines
357 B
Go
27 lines
357 B
Go
package dpi
|
|
|
|
import (
|
|
"errors"
|
|
"fmt"
|
|
)
|
|
|
|
var (
|
|
ErrInvalid = errors.New("invalid")
|
|
)
|
|
|
|
type DecodeError struct {
|
|
Reason string
|
|
Err error
|
|
}
|
|
|
|
func (err DecodeError) Error() string {
|
|
if err.Reason != "" {
|
|
return fmt.Sprintf("dpi: %s: %v", err.Reason, err.Err.Error())
|
|
}
|
|
return err.Error()
|
|
}
|
|
|
|
func (err DecodeError) Unwrap() error {
|
|
return err.Err
|
|
}
|