chore: clear error message with unauthorized credentials (#5236)

This commit is contained in:
M Alvee
2025-07-23 13:36:17 -07:00
committed by GitHub
parent ee72571936
commit ae1eab7d52
2 changed files with 5 additions and 2 deletions
+1 -1
View File
@@ -336,7 +336,7 @@ func prepareCopyURLs(ctx context.Context, o prepareCopyURLsOpts) chan URLs {
defer close(copyURLsCh)
copyURLsContent, err := guessCopyURLType(ctx, o)
if err != nil {
copyURLsCh <- URLs{Error: errUnableToGuess().Trace(o.sourceURLs...)}
copyURLsCh <- URLs{Error: errUnableToGuess(err.Cause.Error()).Trace(o.sourceURLs...)}
return
}
+4 -1
View File
@@ -41,8 +41,11 @@ var errInvalidArgument = func() *probe.Error {
type unableToGuessErr error
var errUnableToGuess = func() *probe.Error {
var errUnableToGuess = func(customMsg string) *probe.Error {
msg := "Unable to guess the type of copy operation."
if strings.TrimSpace(customMsg) != "" {
msg = customMsg
}
return probe.NewError(unableToGuessErr(errors.New(msg)))
}