mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Better error message when setting values on directories
Without this commit etcd returns the following error message when
setting values on directories:
{
"errorCode":102,
"message":"Not a file",
"cause":"/postgres",
"index":2
}
While the above error message is accurate it's not very descriptive.
This commit adds a new error code/message which better describes why the
write operation failed. etcd now returns the following:
{
"errorCode":109,
"message":"Cannot set value on directory",
"cause":"/postgres",
"index":2
}
This commit is contained in:
@@ -21,6 +21,7 @@ Error code corresponding strerror
|
||||
EcodeNotDir = 104
|
||||
EcodeNodeExist = 105
|
||||
EcodeKeyIsPreserved = 106
|
||||
EcodeNoValueOnDir = 109
|
||||
|
||||
EcodeValueRequired = 200
|
||||
EcodePrevValueRequired = 201
|
||||
@@ -42,6 +43,7 @@ Error code corresponding strerror
|
||||
errors[104] = "Not A Directory"
|
||||
errors[105] = "Already exists" // create
|
||||
errors[106] = "The prefix of given key is a keyword in etcd"
|
||||
errors[109] = "Cannot set value on directory"
|
||||
|
||||
// Post form related errors
|
||||
errors[200] = "Value is Required in POST form"
|
||||
|
||||
Reference in New Issue
Block a user