Skip to content

Commit

Permalink
Merge pull request #1134 from sul-dlss/hb
Browse files Browse the repository at this point in the history
Add a honeybadger notice if we can't find the effective loan policy in our cache
  • Loading branch information
cbeer authored Jun 24, 2024
2 parents 0676777 + f53acd2 commit 8250f71
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/models/folio/checkout.rb
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,11 @@ def loan_policy
end

def effective_loan_policy
@effective_loan_policy ||= Folio::Types.loan_policies[effective_loan_policy_id]
@effective_loan_policy ||= Folio::Types.loan_policies.fetch(effective_loan_policy_id) do
Honeybadger.notify('Unable to find loan policy for checkout',
context: { key:, effective_loan_policy_id: })
{}
end
end

# NOTE: We need to fetch the latest loan policy to evaluate renewability. The loan policy returned
Expand Down

0 comments on commit 8250f71

Please sign in to comment.