Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve mc-cp error message #2208

Merged
merged 1 commit into from Jul 15, 2017
Merged

Improve mc-cp error message #2208

merged 1 commit into from Jul 15, 2017

Conversation

krisis
Copy link
Member

@krisis krisis commented Jul 10, 2017

Fixes #2195

@krisis
Copy link
Member Author

krisis commented Jul 10, 2017

Sample output:

➜  mc git:(issue/2195) mc cp mygcs/testkp-1/xl-v1/go .
mc: <ERROR> Source mygcs/testkp-1/xl-v1/go doesn't exist.

@codecov-io
Copy link

codecov-io commented Jul 10, 2017

Codecov Report

Merging #2208 into master will not change coverage.
The diff coverage is 0%.

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #2208   +/-   ##
======================================
  Coverage    9.02%   9.02%           
======================================
  Files          93      93           
  Lines        6902    6902           
======================================
  Hits          623     623           
  Misses       6152    6152           
  Partials      127     127
Impacted Files Coverage Δ
cmd/cp-url-syntax.go 0% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 54a7460...24f3e0d. Read the comment docs.

@@ -42,7 +43,7 @@ func checkCopySyntax(ctx *cli.Context) {
for _, srcURL := range srcURLs {
_, _, err := url2Stat(srcURL)
if err != nil {
fatalIf(err.Trace(srcURL), fmt.Sprintf("Unable to stat '%s'.", srcURL))
console.Fatalf("Source %s doesn't exist.\n", srcURL)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couldn't this be sometimes a network problem ?

We probably can find a better phrase than 'Unable to stat' of this latter is considered not user friendly

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: "Unable to determine validity of source %s"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vadmeste does the above phrase look better? If so, I can update the PR with @fwessels' suggestion.

Copy link
Member

@vadmeste vadmeste left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Posted one comment, need to be discussed

@@ -42,7 +43,7 @@ func checkCopySyntax(ctx *cli.Context) {
for _, srcURL := range srcURLs {
_, _, err := url2Stat(srcURL)
if err != nil {
fatalIf(err.Trace(srcURL), fmt.Sprintf("Unable to stat '%s'.", srcURL))
console.Fatalf("Unable to determine validity of source %s\n", srcURL)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unable to validate source %s
or
Unable to check source %s
or
Unable to locate source %s

I think these would be better. I'll approve if you vote for no.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the first option

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vadmeste, @fwessels I have update the PR with the first option.

Copy link
Member

@vadmeste vadmeste left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@deekoder deekoder requested review from harshavardhana and removed request for fwessels July 14, 2017 21:36
@deekoder deekoder merged commit 8d7888e into minio:master Jul 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants