1
0
mirror of https://github.com/minio/mc.git synced 2025-11-16 11:02:34 +03:00

Implement console.Fatals, Errors, Infos, Prints for structure input and printing

This commit is contained in:
Harshavardhana
2015-05-26 17:56:36 -07:00
parent 3e24f7ae21
commit 25f847b3b6
11 changed files with 156 additions and 85 deletions

View File

@@ -33,7 +33,7 @@ func runSyncCmd(ctx *cli.Context) {
}
if !isMcConfigExist() {
console.Fatalln(ErrorMessage{
console.Fatals(ErrorMessage{
Message: "Please run \"mc config generate\"",
Error: iodine.New(errors.New("\"mc\" is not configured"), nil),
})
@@ -41,7 +41,7 @@ func runSyncCmd(ctx *cli.Context) {
URLs, err := args2URLs(ctx.Args())
if err != nil {
console.Fatalln(ErrorMessage{
console.Fatals(ErrorMessage{
Message: fmt.Sprintf("Unknown URL types found: %s", URLs),
Error: iodine.New(err, nil),
})
@@ -76,7 +76,7 @@ func runSyncCmd(ctx *cli.Context) {
for syncURLs := range prepareSyncURLs(sourceURL, targetURLs) {
if syncURLs.Error != nil {
console.Errorln(ErrorMessage{
console.Errors(ErrorMessage{
Message: "Failed with",
Error: iodine.New(syncURLs.Error, nil),
})
@@ -88,7 +88,7 @@ func runSyncCmd(ctx *cli.Context) {
defer wg.Done()
srcConfig, err := getHostConfig(syncURLs.SourceContent.Name)
if err != nil {
console.Fatalln(ErrorMessage{
console.Fatals(ErrorMessage{
Message: "Failed with",
Error: iodine.New(err, nil),
})
@@ -96,14 +96,14 @@ func runSyncCmd(ctx *cli.Context) {
}
tgtConfig, err := getHostConfig(syncURLs.TargetContent.Name)
if err != nil {
console.Fatalln(ErrorMessage{
console.Fatals(ErrorMessage{
Message: "Failed with",
Error: iodine.New(err, nil),
})
return
}
if err := doCopy(syncURLs.SourceContent.Name, srcConfig, syncURLs.TargetContent.Name, tgtConfig, bar); err != nil {
console.Errorln(ErrorMessage{
console.Errors(ErrorMessage{
Message: "Failed with",
Error: iodine.New(err, nil),
})