From 15508cfe0bd4614a16998206c8db3606081ef9d9 Mon Sep 17 00:00:00 2001 From: Cnly Date: Tue, 1 Oct 2019 11:31:47 +0800 Subject: [PATCH] Remove redundant type cast for now Signed-off-by: Alex Chen --- clientapi/routing/directory.go | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/clientapi/routing/directory.go b/clientapi/routing/directory.go index ed8ee2316..574b275d6 100644 --- a/clientapi/routing/directory.go +++ b/clientapi/routing/directory.go @@ -24,7 +24,6 @@ import ( "github.com/matrix-org/dendrite/common/config" federationSenderAPI "github.com/matrix-org/dendrite/federationsender/api" roomserverAPI "github.com/matrix-org/dendrite/roomserver/api" - "github.com/matrix-org/gomatrix" "github.com/matrix-org/gomatrixserverlib" "github.com/matrix-org/util" ) @@ -75,14 +74,9 @@ func DirectoryRoom( if domain != cfg.Matrix.ServerName { fedRes, fedErr := federation.LookupRoomAlias(req.Context(), domain, roomAlias) if fedErr != nil { - switch fedErr.(type) { - case gomatrix.HTTPError: - // TODO: Return 502 if the remote server errored. - // TODO: Return 504 if the remote server timed out. - return httputil.LogThenError(req, fedErr) - default: - return httputil.LogThenError(req, fedErr) - } + // TODO: Return 502 if the remote server errored. + // TODO: Return 504 if the remote server timed out. + return httputil.LogThenError(req, fedErr) } res.RoomID = fedRes.RoomID res.fillServers(fedRes.Servers)