Documentation ¶
Index ¶
- Variables
- func ExplainDiagnostics(diagStr string) ([]string, error)
- func Log(e error) error
- func LogWithFields(e error, fields log.Fields) error
- func ModelCheckerError(err error) error
- func ModelReticulationError(err error) error
- func MxCompileError(errStack string) error
- func ToGRPCError(e error) error
- type MergeError
- func AlreadyExistsError(what, instance string) *MergeError
- func BadRealizeActionError(badaction, instance string) *MergeError
- func BadRequestError(detail string) *MergeError
- func DataCorruptionError(name string, err error) *MergeError
- func DatabaseError(detail string, err error) *MergeError
- func EmptyExperimentError() *MergeError
- func EmptyTestbedError() *MergeError
- func ForbiddenError(detail string) *MergeError
- func FromGRPCError(e error) *MergeError
- func FromModelError(e []byte) (*MergeError, error)
- func IdentityError(messages []string) *MergeError
- func InternalError(title, detail, eType string, err error) *MergeError
- func MaterializeInProgressError(id string) *MergeError
- func NewMergeError(err error) *MergeError
- func NoProjectResources(pid string) *MergeError
- func NotFoundError(what, instance string) *MergeError
- func RealizeInProgressError(id string) *MergeError
- func SvcConnectionError(name string, err error) *MergeError
- func ToMergeError(err error) *MergeError
- func UnauthorizedError(detail string) *MergeError
- func UncategorizedError(detail string, err error) *MergeError
- func UserInactiveError(detail string) *MergeError
Constants ¶
This section is empty.
Variables ¶
var ( // Standard Errors ErrBadRequest = errors.New("Bad Request") ErrForbidden = errors.New("Forbidden") ErrUserInactive = errors.New("User Inactive") ErrNotFound = errors.New("Not Found") ErrAlreadyExists = errors.New("Already Exists") ErrInternal = errors.New("Internal Error") )
Standard Errors
var ( ErrMxCompileError = errors.New("MX failed to compile") ErrReticulationError = errors.New("Reticulation Error") ErrCheckerError = errors.New("Checker Error") )
var ( ErrEmptyExperiment = errors.New("Empty Experiment") ErrEmptyTestbed = errors.New("Empty Testbed") ErrRlzBadXir = errors.New("Bad Realzation XIR") ErrRlzInternal = errors.New("Realization Internal") ErrFailedToRealize = errors.New("Failed to Realize") ErrRealizeInProgress = errors.New("Realization in Progress") ErrMaterializeInProgress = errors.New("Materialization in Progress") ErrBadRealizeAction = errors.New("Bad Realize Action") ErrNoProjectResources = errors.New("No Resources For Project") )
var ( // Just wrap kratos errors in this so thye can be parsed as merge errors ErrIdentityError = errors.New("Identity Error") )
Functions ¶
func ExplainDiagnostics ¶
TODO redo for new diagnostics format
func LogWithFields ¶
LogWithFields log as Merge Error if possible, else just log.
func ModelCheckerError ¶ added in v1.2.3
func ModelReticulationError ¶
func MxCompileError ¶
func ToGRPCError ¶
Types ¶
type MergeError ¶
type MergeError struct { Type string `json:"type,omitempty"` Title string `json:"title,omitempty"` Detail string `json:"detail,omitempty"` Instance string `json:"instance,omitempty"` Evidence string `json:"evidence,omitempty"` Timestamp string `json:"timestamp,omitempty"` Err error `json:"err,omitempty"` }
MergeError encapsulates an error in a Merge Portal. This currently mirrors the model.Error, but is written out again here to keep the API data structures separate from the internal Merge data structures. It also wraps the underlying error for tpe comparison and any other data it holds
Informational fields in the struct are based on RFC 7807 https://tools.ietf.org/html/rfc7807
func AlreadyExistsError ¶
func AlreadyExistsError(what, instance string) *MergeError
func BadRealizeActionError ¶
func BadRealizeActionError(badaction, instance string) *MergeError
func BadRequestError ¶
func BadRequestError(detail string) *MergeError
func DataCorruptionError ¶
func DataCorruptionError(name string, err error) *MergeError
func DatabaseError ¶
func DatabaseError(detail string, err error) *MergeError
func EmptyExperimentError ¶
func EmptyExperimentError() *MergeError
func EmptyTestbedError ¶
func EmptyTestbedError() *MergeError
func ForbiddenError ¶
func ForbiddenError(detail string) *MergeError
func FromGRPCError ¶
func FromGRPCError(e error) *MergeError
func FromModelError ¶
func FromModelError(e []byte) (*MergeError, error)
FromModelError - convert from Merge API error to MergeError
func IdentityError ¶ added in v1.2.9
func IdentityError(messages []string) *MergeError
func InternalError ¶
func InternalError(title, detail, eType string, err error) *MergeError
InternalError is wrapped in a MergeError
func MaterializeInProgressError ¶ added in v1.2.3
func MaterializeInProgressError(id string) *MergeError
func NewMergeError ¶
func NewMergeError(err error) *MergeError
func NoProjectResources ¶
func NoProjectResources(pid string) *MergeError
func NotFoundError ¶
func NotFoundError(what, instance string) *MergeError
func RealizeInProgressError ¶ added in v1.2.3
func RealizeInProgressError(id string) *MergeError
func SvcConnectionError ¶
func SvcConnectionError(name string, err error) *MergeError
func ToMergeError ¶
func ToMergeError(err error) *MergeError
ToMergeError - Given an arbitrary error, convert to MergeError
func UnauthorizedError ¶
func UnauthorizedError(detail string) *MergeError
func UncategorizedError ¶
func UncategorizedError(detail string, err error) *MergeError
func UserInactiveError ¶ added in v1.1.22
func UserInactiveError(detail string) *MergeError
func (MergeError) Error ¶
func (me MergeError) Error() string
Error implements the go error interface.
func (*MergeError) Is ¶
func (me *MergeError) Is(target error) bool
func (*MergeError) Log ¶
func (me *MergeError) Log() error
Log this error at the Error level. Returns itself.
func (*MergeError) LogWithFields ¶
func (me *MergeError) LogWithFields(flds log.Fields) error
LogWithFields logs the error and returns itself
func (*MergeError) String ¶
func (me *MergeError) String() string
ToString "translates" the error to a pretty printed string suitable for dumping to stdout/stderr.
func (*MergeError) Unwrap ¶
func (me *MergeError) Unwrap() error