From 20a72df439d76747c8675e3b6d5e460f01e3c311 Mon Sep 17 00:00:00 2001 From: Daniel <dhaavi@users.noreply.github.com> Date: Tue, 23 Apr 2024 10:46:09 +0200 Subject: [PATCH] Improve error messages for not ready API endpoints --- api/endpoints.go | 2 +- api/router.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/endpoints.go b/api/endpoints.go index 2936930..7ea23a1 100644 --- a/api/endpoints.go +++ b/api/endpoints.go @@ -381,7 +381,7 @@ func (e *Endpoint) ServeHTTP(w http.ResponseWriter, r *http.Request) { // Wait for the owning module to be ready. if !moduleIsReady(e.BelongsTo) { - http.Error(w, "The API endpoint is not ready yet or the its module is not enabled. Please try again later.", http.StatusServiceUnavailable) + http.Error(w, "The API endpoint is not ready yet or the its module is not enabled. Reload (F5) to try again.", http.StatusServiceUnavailable) return } diff --git a/api/router.go b/api/router.go index f43bef7..470a272 100644 --- a/api/router.go +++ b/api/router.go @@ -271,7 +271,7 @@ func (mh *mainHandler) handle(w http.ResponseWriter, r *http.Request) error { // Wait for the owning module to be ready. if moduleHandler, ok := handler.(ModuleHandler); ok { if !moduleIsReady(moduleHandler.BelongsTo()) { - http.Error(lrw, "The API endpoint is not ready yet. Please try again later.", http.StatusServiceUnavailable) + http.Error(lrw, "The API endpoint is not ready yet. Reload (F5) to try again.", http.StatusServiceUnavailable) return nil } }