mirror of
https://github.com/psviderski/uncloud.git
synced 2026-08-26 11:03:34 +00:00
fix: return non-exit code when uc commands cancelled by not confirming prompt (fixes #354)
This commit is contained in:
@@ -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}
|
||||
}
|
||||
Reference in New Issue
Block a user