INNER CODE UNIT · Go

newCLIError

geekjourneyx/md2wechat-skill · cmd/md2wechat/main.go:151

func newCLIError(code, message string) error {
	return &cliError{Code: code, Message: message}
}

func newCLIErrorWithDetails(code, message string, details map[string]any, nextActions []string) error {
	return &cliError{Code: code, Message: message, Details: details, NextActions: nextActions}
}

func wrapCLIError(code string, err error, message string) error {
	return &cliError{Code: code, Message: message, Err: err}
}

func extractCLIError(err error) (*cliError, bool) {
	var cliErr *cliError
	if errors.As(err, &cliErr) {
		return cliErr, true
	}
	return nil, false

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…