mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-07 17:15:56 +00:00
Fix panic on field not found on /import
This commit is contained in:
parent
dbf9b14963
commit
c021b873d5
1 changed files with 3 additions and 3 deletions
|
|
@ -2372,8 +2372,8 @@ func (h *Handler) handlePostImportAtomicRecord(w http.ResponseWriter, r *http.Re
|
|||
// handlePostImport handles /import requests.
|
||||
func (h *Handler) handlePostImport(w http.ResponseWriter, r *http.Request) {
|
||||
// Verify that request is only communicating over protobufs.
|
||||
if error, code := validateProtobufHeader(r); error != "" {
|
||||
http.Error(w, error, code)
|
||||
if err, code := validateProtobufHeader(r); err != "" {
|
||||
http.Error(w, err, code)
|
||||
return
|
||||
}
|
||||
|
||||
|
|
@ -2392,7 +2392,7 @@ func (h *Handler) handlePostImport(w http.ResponseWriter, r *http.Request) {
|
|||
fieldName := mux.Vars(r)["field"]
|
||||
field := index.Field(fieldName)
|
||||
if field == nil {
|
||||
http.Error(w, err.Error(), http.StatusNotFound)
|
||||
http.Error(w, pilosa.ErrFieldNotFound.Error(), http.StatusNotFound)
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue