From 09d44429d1bdf3fe9e7051a4253f4027e111b6ab 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 b19a827d..ffeaf2a9 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, "") } }