X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/f6e8752348958e3bb48c7509a4ff78689f2d64c9..62612ee23efe146829a7bb64817cdd23f41775bb:/services/api/app/controllers/arvados/v1/groups_controller.rb diff --git a/services/api/app/controllers/arvados/v1/groups_controller.rb b/services/api/app/controllers/arvados/v1/groups_controller.rb index 3473c7e4e0..e9bc006a36 100644 --- a/services/api/app/controllers/arvados/v1/groups_controller.rb +++ b/services/api/app/controllers/arvados/v1/groups_controller.rb @@ -263,6 +263,9 @@ class Arvados::V1::GroupsController < ApplicationController included_by_uuid = {} seen_last_class = false + error_by_class = {} + any_success = false + klasses.each do |klass| # check if current klass is same as params['last_object_class'] seen_last_class = true if((params['count'].andand.==('none')) and @@ -318,7 +321,19 @@ class Arvados::V1::GroupsController < ApplicationController # Adjust the limit based on number of objects fetched so far klass_limit = limit_all - all_objects.count @limit = klass_limit - apply_where_limit_order_params klass + + begin + apply_where_limit_order_params klass + rescue ArgumentError => e + if e.inspect =~ /Invalid attribute '.+' for operator '.+' in filter/ or + e.inspect =~ /Invalid attribute '.+' for subproperty filter/ + error_by_class[klass.name] = e + next + end + raise + else + any_success = true + end # This actually fetches the objects klass_object_list = object_list(model_class: klass) @@ -349,6 +364,14 @@ class Arvados::V1::GroupsController < ApplicationController end end + # Only error out when every searchable object type errored out + if !any_success && error_by_class.size > 0 + error_msg = error_by_class.collect do |klass, err| + "#{err} on object type #{klass}" + end.join("\n") + raise ArgumentError.new(error_msg) + end + if params["include"] @extra_included = included_by_uuid.values end