Print friendly message rather than fatalIf and exit cleanly.

This commit is contained in:
Harshavardhana
2015-09-25 20:52:16 -07:00
parent f8d26ebac7
commit 1e346fc118
3 changed files with 9 additions and 3 deletions
+4 -1
View File
@@ -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
View File
@@ -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
View File
@@ -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.