fix: improve error message for invalid input in lookup functionality
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:
@@ -27,7 +27,7 @@ func (s *Server) handleLookup(w http.ResponseWriter, r *http.Request) {
|
|||||||
res, err := lookup.Lookup(s.store, a.TenantID, q)
|
res, err := lookup.Lookup(s.store, a.TenantID, q)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if errors.Is(err, store.ErrInvalidInput) {
|
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
|
return
|
||||||
}
|
}
|
||||||
writeStoreErr(w, err)
|
writeStoreErr(w, err)
|
||||||
|
|||||||
Reference in New Issue
Block a user