Print friendly message rather than fatalIf and exit cleanly.
This commit is contained in:
+4
-1
@@ -261,7 +261,10 @@ func doCopyCmdSession(session *sessionV2) {
|
||||
console.Printf("%c[2K\n", 27)
|
||||
console.Printf("%c[A", 27)
|
||||
}
|
||||
fatalIf(cpURLs.Error.Trace(), fmt.Sprintf("Failed to copy ‘%s’.", cpURLs.SourceContent.Name))
|
||||
errorIf(cpURLs.Error.Trace(), fmt.Sprintf("Failed to copy ‘%s’.", cpURLs.SourceContent.Name))
|
||||
session.Close()
|
||||
session.Info()
|
||||
os.Exit(0)
|
||||
}
|
||||
case <-trapCh: // Receive interrupt notification.
|
||||
// Print in new line and adjust to top so that we don't print over the ongoing progress bar
|
||||
|
||||
+4
-1
@@ -259,7 +259,10 @@ func doMirrorCmdSession(session *sessionV2) {
|
||||
console.Printf("%c[2K\n", 27)
|
||||
console.Printf("%c[A", 27)
|
||||
}
|
||||
fatalIf(sURLs.Error.Trace(), "Failed to mirror.")
|
||||
errorIf(sURLs.Error.Trace(), "Failed to mirror.")
|
||||
session.Close()
|
||||
session.Info()
|
||||
os.Exit(0)
|
||||
}
|
||||
case <-trapCh: // Receive interrupt notification.
|
||||
// Print in new line and adjust to top so that we don't print over the ongoing progress bar
|
||||
|
||||
+1
-1
@@ -128,7 +128,7 @@ func newSessionV2() *sessionV2 {
|
||||
|
||||
// String printer for SessionV2
|
||||
func (s sessionV2) Info() {
|
||||
console.Infoln("Session terminated. To resume session ‘mc session resume " + s.SessionID + "’")
|
||||
console.Infoln("Session safely terminated. To resume session ‘mc session resume " + s.SessionID + "’")
|
||||
}
|
||||
|
||||
// HasData provides true if this is a session resume, false otherwise.
|
||||
|
||||
Reference in New Issue
Block a user