Skip to content

Commit

Permalink
add context to failure to find label
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-butcher committed Mar 19, 2024
1 parent bad238c commit 8eff109
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,12 @@ trait MarcElectronicResources extends Logging {
// Return title as Left or linkText as Right
protected def getTitleOrLinkText(
field: MarcField
): Try[Either[String, String]] = getLabel(field) match {
)(implicit ctx: LoggingContext): Try[Either[String, String]] = getLabel(
field
) match {
case "" =>
Failure(
new Exception(s"could not construct a label from 856 field $field")
new Exception(ctx(s"could not construct a label from 856 field $field"))
)
case label => Success(Left(label))
}
Expand Down

0 comments on commit 8eff109

Please sign in to comment.