Unverified Commit f54a02c6 authored by Sebastian Schüpbach's avatar Sebastian Schüpbach
Browse files

print preciser error messages when retrieving failed

Signed-off-by: Sebastian Schüpbach's avatarSebastian Schüpbach <sebastian.schuepbach@unibas.ch>
parent 2b6496e2
Pipeline #18033 passed with stages
in 7 minutes and 59 seconds
...@@ -65,16 +65,16 @@ object App extends scala.App with Logging with RecordUtils { ...@@ -65,16 +65,16 @@ object App extends scala.App with Logging with RecordUtils {
processed <- recordProcessor.process(record) processed <- recordProcessor.process(record)
} yield (record, processed) match { } yield (record, processed) match {
case (rec, ProcessSuccess(id, msg)) => case (rec, ProcessSuccess(id, msg)) =>
logger.debug(msg) logger.debug(s"$id: $msg")
reporter.send(ReportingObject(id, ProcessingSuccess, msg, getInstitutionAndRecordSet(rec.value))) reporter.send(ReportingObject(id, ProcessingSuccess, msg, getInstitutionAndRecordSet(rec.value)))
case (rec, ProcessIgnore(id, msg)) => case (rec, ProcessIgnore(id, msg)) =>
logger.info(msg) logger.info(s"$id: $msg")
reporter.send(ReportingObject(id, ProcessingIgnore, msg, getInstitutionAndRecordSet(rec.value))) reporter.send(ReportingObject(id, ProcessingIgnore, msg, getInstitutionAndRecordSet(rec.value)))
case (rec, ProcessWarning(id, msg)) => case (rec, ProcessWarning(id, msg)) =>
logger.warn(msg) logger.warn(s"$id: $msg")
reporter.send(ReportingObject(id, ProcessingWarning, msg, getInstitutionAndRecordSet(rec.value))) reporter.send(ReportingObject(id, ProcessingWarning, msg, getInstitutionAndRecordSet(rec.value)))
case (rec, ProcessFatal(id, msg, ex)) => case (rec, ProcessFatal(id, msg, ex)) =>
logger.error(msg) logger.error(s"$id: $msg: ${ex.getMessage}")
logger.debug(ex.getStackTrace.mkString("\n")) logger.debug(ex.getStackTrace.mkString("\n"))
reporter.send(ReportingObject(id, ProcessingFatal, msg, getInstitutionAndRecordSet(rec.value))) reporter.send(ReportingObject(id, ProcessingFatal, msg, getInstitutionAndRecordSet(rec.value)))
} }
...@@ -68,7 +68,7 @@ class RecordProcessor(fileHandler: DisseminationCopyHandler, ...@@ -68,7 +68,7 @@ class RecordProcessor(fileHandler: DisseminationCopyHandler,
binaryResource.mimeType, binaryResource.mimeType,
binaryResource.instantiationType, binaryResource.instantiationType,
data) data)
case Failure(ex) => List(ProcessFatal(recordKey, "Failed to retrieve binary from Fedora", ex)) case Failure(ex) => List(ProcessFatal(recordKey, s"Failed to retrieve binary from Fedora on ${binaryResource.filePath}", ex))
} }
} }
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment