Skip to content

Commit

Permalink
[ws-proxy] Skip DNS errors when workspace is not available
Browse files Browse the repository at this point in the history
  • Loading branch information
aledbf authored and roboquat committed Jul 26, 2021
1 parent 79fd1d0 commit f6aea00
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion components/ws-proxy/pkg/proxy/pass.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
package proxy

import (
"errors"
"fmt"
"net"
"net/http"
Expand Down Expand Up @@ -106,7 +107,12 @@ func proxyPass(config *RouteHandlerConfig, resolver targetResolver, opts ...prox
return
}

log.WithField("url", originalURL.String()).WithError(err).Error("proxied request failed")
var dnsError *net.DNSError
if !errors.As(err, &dnsError) {
// skip "no such host" errors (workspace service not available, yet)
log.WithField("url", originalURL.String()).WithError(err).Error("proxied request failed")
}

rw.WriteHeader(http.StatusBadGateway)
}

Expand Down

0 comments on commit f6aea00

Please sign in to comment.