government / src / policy / error.go

@ 25d85a34ec701b64fde8050571d39eaa9b8d1bbb | history


package policy

import "fmt"

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

// ErrTooLarge: building the graph would exceed the node budget.
const ErrTooLarge = "E-TOO-LARGE"

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...)}
}