Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the exceptions returned from overdrive API (PP-2154) #2300

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jonathangreen
Copy link
Member

@jonathangreen jonathangreen commented Feb 25, 2025

Description

Some minor updates to the Overdrive API based on the investigation I'm doing in PP-2154.

  • If a book is already on hold return the AlreadyOnHold exception instead of returning a hold info object.
  • If a book is checked out when we go to make a loan, don't do an availability sync, just raise NoAvailableCopies.

In both these cases the Circulation API that calls the Overdrive API was doing the same work that was being done in the Overdrive API, so we should just do the simple thing, and let the caller handle the outcome.

I'll add some context in comments on the PR.

Motivation and Context

These don't fix the holds issue in PP-2154, but I think they are good changes to make anyway, having followed through some full OD requests in the debugger.

How Has This Been Tested?

  • Running unit tests
  • Locally testing with OD loans and holds

Checklist

  • I have updated the documentation accordingly.
  • All new and existing tests passed.

Copy link

codecov bot commented Feb 25, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.18%. Comparing base (56cbc4a) to head (2d162e4).
Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2300      +/-   ##
==========================================
+ Coverage   91.13%   91.18%   +0.05%     
==========================================
  Files         362      362              
  Lines       41361    41358       -3     
  Branches     8863     8863              
==========================================
+ Hits        37693    37711      +18     
+ Misses       2404     2383      -21     
  Partials     1264     1264              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@dbernstein dbernstein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants