Code

Don't try to display metric information after the query failed.
authorSebastian Harl <sh@tokkee.org>
Sat, 21 Feb 2015 23:20:32 +0000 (00:20 +0100)
committerSebastian Harl <sh@tokkee.org>
Sat, 21 Feb 2015 23:20:32 +0000 (00:20 +0100)
server/query.go

index e303d93069a1d094e11489cb8677cef2aa634edc..6f9722c64a6c37130311bf3e15b9586039964764 100644 (file)
@@ -111,7 +111,7 @@ func fetch(req request, s *Server) (*page, error) {
                        return nil, fmt.Errorf("%s not found", strings.Title(req.cmd))
                }
                res, err = s.query("FETCH %s %s.%s", identifier(req.cmd), req.args[0], req.args[1])
                        return nil, fmt.Errorf("%s not found", strings.Title(req.cmd))
                }
                res, err = s.query("FETCH %s %s.%s", identifier(req.cmd), req.args[0], req.args[1])
-               if req.cmd == "metric" {
+               if err == nil && req.cmd == "metric" {
                        return metric(req, res, s)
                }
        default:
                        return metric(req, res, s)
                }
        default: