Finalize inbox artifacts and error protocol

This commit is contained in:
2026-03-19 03:25:06 +08:00
parent c3314cd9cf
commit f315d2330d
22 changed files with 659 additions and 86 deletions
+33
View File
@@ -0,0 +1,33 @@
package protocol
type CLIError struct {
Code string
ExitCode int
Message string
Err error
}
func (e *CLIError) Error() string {
return e.Message
}
func (e *CLIError) Unwrap() error {
return e.Err
}
func NewCLIError(code string, exitCode int, message string, err error) error {
return &CLIError{
Code: code,
ExitCode: exitCode,
Message: message,
Err: err,
}
}
func InvalidInput(message string, err error) error {
return NewCLIError("invalid_input", 30, message, err)
}
func NoMatchingWork(message string) error {
return NewCLIError("no_matching_work", 10, message, nil)
}