diff --git a/src/metabase/api/routes.clj b/src/metabase/api/routes.clj index 9ca6732deee0806b08964766a234ee3b976c3f53..75367a717f37ca99a91ac80dd9280e5d190b7d8c 100644 --- a/src/metabase/api/routes.clj +++ b/src/metabase/api/routes.clj @@ -36,7 +36,8 @@ [user :as user] [util :as util] [x-ray :as x-ray]] - [metabase.middleware :as middleware])) + [metabase.middleware :as middleware] + [puppetlabs.i18n.core :refer [tru]])) (def ^:private +generic-exceptions "Wrap ROUTES so any Exception thrown is just returned as a generic 400, to prevent details from leaking in public @@ -90,6 +91,4 @@ (context "/tiles" [] (+auth tiles/routes)) (context "/user" [] (+auth user/routes)) (context "/util" [] util/routes) - (route/not-found (fn [{:keys [request-method uri]}] - {:status 404 - :body (str (.toUpperCase (name request-method)) " " uri " does not exist.")}))) + (route/not-found (constantly {:status 404, :body (tru "API endpoint does not exist.")})))