Skip to content

Commit

Permalink
Handle and report exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
kwahlin committed Nov 20, 2023
1 parent a9c0daf commit 3746bd0
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
// LXL-2512: Move contribution by relator domain

import whelk.converter.marc.ContributionByRoleStep

unhandled = getReportWriter('unhandled.txt')

ruleSets = getWhelk().marcFrameConverter.conversion.marcRuleSets
contribStep = ruleSets.bib.postProcSteps.find { it instanceof ContributionByRoleStep }

Expand All @@ -12,8 +15,12 @@ def where = """

selectBySqlWhere(where) {
def instance = it.graph[1]
def instanceType = instance[TYPE]
if (contribStep.moveRoles(instance)) {
it.scheduleSave()

try {
if (contribStep.moveRoles(instance)) {
it.scheduleSave()
}
} catch (Exception e) {
unhandled.println("${it.doc.shortId}: ${e}")
}
}

0 comments on commit 3746bd0

Please sign in to comment.