mirror of
https://github.com/minio/mc.git
synced 2025-11-13 12:22:45 +03:00
Improve error messages
This commit is contained in:
@@ -16,29 +16,7 @@
|
||||
|
||||
package main
|
||||
|
||||
type errUnexpected struct{}
|
||||
|
||||
func (e errUnexpected) Error() string {
|
||||
return "Unexpected control flow, please report this bug at https://github.com/minio/mc/issues."
|
||||
}
|
||||
|
||||
type errInvalidSessionID struct {
|
||||
id string
|
||||
}
|
||||
|
||||
func (e errInvalidSessionID) Error() string {
|
||||
return "Invalid session id ‘" + e.id + "’."
|
||||
}
|
||||
|
||||
/*
|
||||
type errInvalidACL struct {
|
||||
acl string
|
||||
}
|
||||
|
||||
func (e errInvalidACL) Error() string {
|
||||
return "Invalid ACL Type ‘" + e.acl + "’. Valid types are [private, public, readonly]."
|
||||
}
|
||||
*/
|
||||
import "errors"
|
||||
|
||||
type errNotAnObject struct {
|
||||
url string
|
||||
@@ -48,11 +26,7 @@ func (e errNotAnObject) Error() string {
|
||||
return "URL: ‘" + e.url + "’ not an object"
|
||||
}
|
||||
|
||||
type errInvalidArgument struct{}
|
||||
|
||||
func (e errInvalidArgument) Error() string {
|
||||
return "Incorrect usage, please use \"mc config help\""
|
||||
}
|
||||
var errInvalidArgument = errors.New("Invalid arguments provided, cannot proceed")
|
||||
|
||||
type errInvalidGlobURL struct {
|
||||
glob string
|
||||
@@ -63,22 +37,6 @@ func (e errInvalidGlobURL) Error() string {
|
||||
return "Error reading glob URL " + e.glob + " while comparing with " + e.request
|
||||
}
|
||||
|
||||
type errReservedAliasName struct {
|
||||
alias string
|
||||
}
|
||||
|
||||
func (e errReservedAliasName) Error() string {
|
||||
return "Alias name ‘" + e.alias + "’ is a reserved word, reserved words are [help, private, readonly, public, authenticated]"
|
||||
}
|
||||
|
||||
type errInvalidAliasName struct {
|
||||
alias string
|
||||
}
|
||||
|
||||
func (e errInvalidAliasName) Error() string {
|
||||
return "Alias name ‘" + e.alias + "’ is invalid, valid examples are: Area51, Grand-Nagus.."
|
||||
}
|
||||
|
||||
type errNoMatchingHost struct {
|
||||
url string
|
||||
}
|
||||
@@ -87,15 +45,6 @@ func (e errNoMatchingHost) Error() string {
|
||||
return "No matching host found for the given url ‘" + e.url + "’"
|
||||
}
|
||||
|
||||
// errAliasExists - alias exists
|
||||
type errAliasExists struct {
|
||||
alias string
|
||||
}
|
||||
|
||||
func (e errAliasExists) Error() string {
|
||||
return "Alias name: ‘" + e.alias + "’ already exists."
|
||||
}
|
||||
|
||||
type errInitClient struct {
|
||||
url string
|
||||
}
|
||||
@@ -148,8 +97,4 @@ func (e errSourceIsNotFile) Error() string {
|
||||
return "Source ‘" + e.URL + "’ is not a file."
|
||||
}
|
||||
|
||||
type errSourceListEmpty errInvalidArgument
|
||||
|
||||
func (e errSourceListEmpty) Error() string {
|
||||
return "Source list is empty."
|
||||
}
|
||||
var errSourceListEmpty = errors.New("Source list is empty.")
|
||||
|
||||
Reference in New Issue
Block a user