government / policy / error.go

@ 7fc9f65a585bd720d0768ecfb4755a050cfd6106 | history


package policy

import "fmt"

// ErrPolicy: policy processing rejected the chain, so the certs do not
// describe a program.
const ErrPolicy = "E-POLICY"

type Error struct {
	Code string
	Msg  string
}

func (e *Error) Error() string { return e.Code + ": " + e.Msg }

func errorf(code, format string, args ...any) *Error {
	return &Error{Code: code, Msg: fmt.Sprintf(format, args...)}
}