From b2a9108ade2c8294b57e100e337cf44c80db061c Mon Sep 17 00:00:00 2001 From: Michael Crosby Date: Fri, 14 Feb 2014 20:38:07 -0800 Subject: [PATCH] Add error for no socket --- dockerui.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dockerui.go b/dockerui.go index 1a68bc37b..e43f533c0 100644 --- a/dockerui.go +++ b/dockerui.go @@ -8,6 +8,7 @@ import ( "net/http" "net/http/httputil" "net/url" + "os" "strings" ) @@ -75,6 +76,12 @@ func createHandler(dir string, e string) http.Handler { if strings.Contains(e, "http") { h = createTcpHandler(e) } else { + if _, err := os.Stat(e); err != nil { + if os.IsNotExist(err) { + log.Fatalf("unix socket %s does not exist", e) + } + log.Fatal(err) + } h = createUnixHandler(e) }