fix: return non-exit code when uc commands cancelled by not confirming prompt (fixes #354)

This commit is contained in:
Pasha Sviderski
2026-05-05 10:41:53 +10:00
parent 34560470ce
commit 5ecd09aa2b
6 changed files with 28 additions and 9 deletions
+15
View File
@@ -0,0 +1,15 @@
package cli
// CancelledError signals an interactive command was aborted by the user at a confirmation prompt.
type CancelledError struct {
Message string
}
func (e *CancelledError) Error() string {
return e.Message
}
// Cancelled returns a CancelledError carrying the given user-facing message.
func Cancelled(msg string) error {
return &CancelledError{Message: msg}
}