From 976996cf5dd7076252ec74186dd049e219fa5904 Mon Sep 17 00:00:00 2001 From: Craig Jellick Date: Tue, 2 Jan 2018 19:18:19 -0700 Subject: [PATCH] return errors where appropriate --- parse/builder/builder.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/parse/builder/builder.go b/parse/builder/builder.go index b19a827d4..ffeaf2a99 100644 --- a/parse/builder/builder.go +++ b/parse/builder/builder.go @@ -183,7 +183,7 @@ func checkFieldCriteria(fieldName string, field types.Field, value interface{}) } if !found { - httperror.NewFieldAPIError(httperror.InvalidOption, fieldName, "") + return httperror.NewFieldAPIError(httperror.InvalidOption, fieldName, "") } } } @@ -191,7 +191,7 @@ func checkFieldCriteria(fieldName string, field types.Field, value interface{}) if len(field.ValidChars) > 0 && hasStrVal { for _, c := range strVal { if !strings.ContainsRune(field.ValidChars, c) { - httperror.NewFieldAPIError(httperror.InvalidCharacters, fieldName, "") + return httperror.NewFieldAPIError(httperror.InvalidCharacters, fieldName, "") } } @@ -199,7 +199,7 @@ func checkFieldCriteria(fieldName string, field types.Field, value interface{}) if len(field.InvalidChars) > 0 && hasStrVal { if strings.ContainsAny(strVal, field.InvalidChars) { - httperror.NewFieldAPIError(httperror.InvalidCharacters, fieldName, "") + return httperror.NewFieldAPIError(httperror.InvalidCharacters, fieldName, "") } }