Last active
August 29, 2015 14:14
-
-
Save jrossi/e5c6f14ca37aa4f66cb5 to your computer and use it in GitHub Desktop.
error issues
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"github.com/coreos/go-etcd/etcd" | |
"log" | |
"os" | |
"reflect" | |
) | |
func main() { | |
conn := etcd.NewClient([]string{"127.0.0.1:4001"}) | |
fmt.Println(conn.GetCluster()) | |
conn.SetCluster(conn.GetCluster()) | |
_, err := conn.Get("/testing/nothinghere", false, false) | |
if err != nil { | |
// https://github.com/coreos/go-etcd/blob/master/etcd/error.go#L18 | |
log.Println(reflect.TypeOf(err)) | |
log.Println(err) | |
//log.Println(err.ErrorCode) | |
os.Exit(1) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# go run main2.go | |
[127.0.0.1:4001] | |
2015/01/26 12:44:18 *etcd.EtcdError | |
2015/01/26 12:44:18 100: Key not found (/testing) [66] | |
exit status 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment