From 17a9cc67f24097bddb574c7efca083b86d6989f4 Mon Sep 17 00:00:00 2001 From: Annika Hannig Date: Mon, 15 May 2023 14:09:52 +0200 Subject: [PATCH 1/2] fixed error display --- ui/src/app/components/errors/Errors.js | 2 +- ui/src/app/components/navigation/RouteServers.js | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/ui/src/app/components/errors/Errors.js b/ui/src/app/components/errors/Errors.js index c2c1f76..2ce8bcd 100644 --- a/ui/src/app/components/errors/Errors.js +++ b/ui/src/app/components/errors/Errors.js @@ -73,7 +73,7 @@ const Error = ({error, onDismiss}) => { {rs && of {rs.name}} {errorStatus}.

-

If this problem persist, we suggest you +

If this problem persists, we suggest you try again later.

); diff --git a/ui/src/app/components/navigation/RouteServers.js b/ui/src/app/components/navigation/RouteServers.js index dafab95..8e86ff6 100644 --- a/ui/src/app/components/navigation/RouteServers.js +++ b/ui/src/app/components/navigation/RouteServers.js @@ -33,15 +33,17 @@ const Status = ({routeServerId}) => { }); }, [routeServerId, handleError]); - if (error && error.code >= 100 && error.code < 200) { + const errorInfo = error?.response?.data; + + if (errorInfo && errorInfo.tag === "CONNECTION_REFUSED") { return (
- unreachable + route server unreachable
); - } else if (error?.response?.data?.tag === "GENERIC_ERROR") { + } else if (errorInfo && errorInfo.tag === "GENERIC_ERROR") { return (
@@ -49,11 +51,11 @@ const Status = ({routeServerId}) => {
); - } else if (error) { + } else if (errorInfo) { return (
- {error.response?.data?.tag} + {errorInfo.tag}
); From ec963a67dbb2add7c6214ba8379097e9cef2f1d7 Mon Sep 17 00:00:00 2001 From: Annika Hannig Date: Mon, 15 May 2023 14:10:22 +0200 Subject: [PATCH 2/2] fixed missing error return --- pkg/http/api_endpoints_routeservers.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/http/api_endpoints_routeservers.go b/pkg/http/api_endpoints_routeservers.go index 12db576..d42754c 100644 --- a/pkg/http/api_endpoints_routeservers.go +++ b/pkg/http/api_endpoints_routeservers.go @@ -62,6 +62,7 @@ func (s *Server) apiRouteServerStatusShow( result, err := source.Status(ctx) if err != nil { s.logSourceError("status", rsID, err) + return nil, err } if result != nil { result.Meta.Version = config.Version