fix: improve error message for invalid input in lookup functionality
CI / changes (push) Successful in 5s
CI / openapi (push) Skipped
CI / web (push) Skipped
CI / commitlint (push) Skipped
CI / go (push) Successful in 54s
CI / bird2 (push) Successful in 17s
CI / release (push) Successful in 3m51s

Updated the error response for invalid input in the handleLookup function to provide a clearer message indicating that the query must be an IP address or FQDN, enhancing user understanding of the input requirements.
This commit is contained in:
Denozordec
2026-07-18 00:05:49 +07:00
parent 1317a73e9a
commit 57bcfcd9e1
+1 -1
View File
@@ -27,7 +27,7 @@ func (s *Server) handleLookup(w http.ResponseWriter, r *http.Request) {
res, err := lookup.Lookup(s.store, a.TenantID, q)
if err != nil {
if errors.Is(err, store.ErrInvalidInput) {
writeProblem(w, http.StatusBadRequest, "Bad Request", err.Error())
writeProblem(w, http.StatusBadRequest, "Bad Request", "query must be an IP address or FQDN")
return
}
writeStoreErr(w, err)