4Science / DSpace

This repository contains the 4Science optimized DSpace & DSpace-CRIS distribution.
https://wiki.lyrasis.org/display/DSPACECRIS/
BSD 3-Clause "New" or "Revised" License
42 stars 61 forks source link

duplicate detection: ignore non-accessibility of database or Solr server (instead of throwing RuntimeException) #345

Open saschaszott opened 1 year ago

saschaszott commented 1 year ago

In the latest DSpace CRIS release, 2023.01.00, the class org.dspace.validation.DetectPotentialDuplicateValidator was added.

A RuntimeException is raised (in the private method findDuplicates) if the database server or Solr server is not accessible. In consequence, this exception is not caught and results in HTTP 500 responses when the UI tries to open "edit forms" of items in collections that are associated with a detect-duplicate step in item-submission.xml.

It should be considered to catch exceptions of type SQLException or SearchServiceException locally in DetectPotentialDuplicateValidator and change this code block (line 90)

        } catch (SQLException | SearchServiceException e) {
            throw new RuntimeException(e); // FIXME remove this line
        }

Instead a proper log message with log level ERROR or WARN should be generated.