From b249efaac66f86df5319ec43f502074ad7ff780b Mon Sep 17 00:00:00 2001 From: Marc Jansing Date: Mon, 1 Jul 2024 15:42:22 +0200 Subject: [PATCH] do not rails exception on searches with invalid colleciton identifier --- app/models/labeling/skos/base.rb | 2 +- app/models/note/base.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/labeling/skos/base.rb b/app/models/labeling/skos/base.rb index 2d3cbc12b..b67c1cb3e 100644 --- a/app/models/labeling/skos/base.rb +++ b/app/models/labeling/skos/base.rb @@ -63,7 +63,7 @@ def self.single_query(params = {}) scope = scope.where("#{Collection::Member::Base.table_name}.collection_id" => collection.id) scope = scope.references(:collection_members) else - raise "Collection with Origin #{params[:collection_origin]} not found!" + Rails.logger.warn "Collection with Origin #{params[:collection_origin]} not found!" end end scope = scope.includes(:owner) diff --git a/app/models/note/base.rb b/app/models/note/base.rb index fc43992a4..fed6cbc42 100644 --- a/app/models/note/base.rb +++ b/app/models/note/base.rb @@ -168,7 +168,7 @@ def self.single_query(params = {}) scope = scope.where("#{Collection::Member::Base.table_name}.collection_id" => collection.id) scope = scope.references(:collection_members) else - raise "Collection with Origin #{params[:collection_origin]} not found!" + Rails.logger.warn "Collection with Origin #{params[:collection_origin]} not found!" end end