mirror of
https://github.com/portainer/portainer.git
synced 2025-07-23 23:39:41 +02:00
Add error for no socket
This commit is contained in:
parent
c3850e4351
commit
b2a9108ade
1 changed files with 7 additions and 0 deletions
|
@ -8,6 +8,7 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/http/httputil"
|
"net/http/httputil"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -75,6 +76,12 @@ func createHandler(dir string, e string) http.Handler {
|
||||||
if strings.Contains(e, "http") {
|
if strings.Contains(e, "http") {
|
||||||
h = createTcpHandler(e)
|
h = createTcpHandler(e)
|
||||||
} else {
|
} 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)
|
h = createUnixHandler(e)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue