diff --git a/core/corehttp/gateway_handler.go b/core/corehttp/gateway_handler.go index d0366390d..32269a170 100644 --- a/core/corehttp/gateway_handler.go +++ b/core/corehttp/gateway_handler.go @@ -159,7 +159,12 @@ func (i *gatewayHandler) getOrHeadHandler(w http.ResponseWriter, r *http.Request } nd, err := core.Resolve(ctx, i.node, path.Path(urlPath)) - if err != nil { + // If node is in offline mode the error code and message should be different + if err == core.ErrNoNamesys && !i.node.OnlineMode() { + w.WriteHeader(http.StatusServiceUnavailable) + fmt.Fprint(w, "Could not resolve path. Node is in offline mode.") + return + } else if err != nil { webError(w, "Path Resolve error", err, http.StatusBadRequest) return }