ValidatePatronTransition Exception Handling
Given the ValidatePatronTransition attempts to validatePatronIdentity and fetch a host patron
When hostLmsPatron.getIsDeleted() != null && hostLmsPatron.getIsDeleted()
Then throw PatronDeletedInHostLmsException :
PatronDeletedInHostLmsException( "Patron with local id " + hostLmsPatron.getLocalId() + " and home library code " + hostLmsPatron.getLocalHomeLibraryCode() + " had a deleted flag.")
Given the ValidatePatronTransition attempts to resolveHomeLibraryCodeFromSystemToAgencyCode
When systemCode == null
Then throw RuntimeException :
RuntimeException("Missing system code. Unable to accept request")
Given the ValidatePatronTransition attempts to resolveHomeLibraryCodeFromSystemToAgencyCode
When return chain completes with empty
Then throw
NoAgencyFoundException
:NoAgencyFoundException("Unable to resolve patron home library code(" + systemCode + "/" + homeLibraryCode + ") to an agency")
Given the ValidatePatronTransition attempts to findOneAgencyByCode
When return chain completes with empty
Then throw
NoAgencyFoundException
:
Additional notes:
No client exceptions within transition.
Uses error transformer
Operated as a Community Resource by the Open Library Foundation