PlacePatronRequestAtSupplyingAgencyStateTransition Exception Handling

PlacePatronRequestAtSupplyingAgencyStateTransition Exception Handling

  • Given the SupplierAgencyService calls requestWorkflowContextHelper

  • When a decorator call fails

  • Then DCB throws a RuntimeException :

    RuntimeException("No agency found for pickup location: %s".formatted(pickupSymbol)
RuntimeException("RWCH No mapping found for pickup location \""+pickupSymbolContext+":"+pickupSymbol+"\"")
RuntimeException("No agency found for pickup location: %s:%s".formatted(pickupSymbolContext,pickupSymbol)
RuntimeException("RWCH No mapping found for pickup location \""+pickupSymbolContext+":"+pickupSymbol+"\""))
RuntimeException("No pickup location code present")
RuntimeException("Unable to resolve agency for pickup location code"+symbol)
RuntimeException("Unable to locate patron request in workflow context")

 

  • Given the SupplierAgencyService calls placeRequestAtSupplier

  • When validating that the context contains required fields

  • Then DCB throws a RuntimeException :

RuntimeException("Invalid RequestWorkflowContext " + psrc)

 

  • Given the SupplierAgencyService calls placeRequestAtSupplier

  • When an error is caught at the end of the return chain

  • Then DCB throws a unableToPlaceRequestAtSupplyingAgencyProblem :

unableToPlaceRequestAtSupplyingAgencyProblem(error, patronRequest, patronIdentityAtSupplier, supplierRequest)

 

  • Given the SupplierAgencyService calls placeHoldRequest

  • When DCB tried to getHomeIdentity

  • Then DCB throws a NoHomeIdentityException :

NoHomeIdentityException(patron.getId(), patron.getPatronIdentities())

 

  • Given the SupplierAgencyService calls checkPatronType

  • When either the know patron or the newly mapped patron type are null

  • Then DCB throws a NullPointerException :

NullPointerException("One or both values are null: " + "known patron type = " + patronType + ", " + "determined patron type = " + newlyMappedVPatronType)

 

  • Given the SupplierAgencyService calls determinePatronType

  • When supplyingHostLmsCode == null || requestingIdentity == null || requestingIdentity.getHostLms() == null || requestingIdentity.getHostLms().getCode() == null

  • Then DCB throws a RuntimeException :

RuntimeException("Missing patron data - unable to determine patron type at supplier:" + supplyingHostLmsCode)

 

  • Given the PatronTypeService calls determinePatronType

  • When clients canonical patron type produces an empty

  • Then DCB throws a NoPatronTypeMappingFoundException :

NoPatronTypeMappingFoundException("Unable to map patron type "+requesterPatronType+"@"+requesterHostLmsCode+" to a canonical value")

 

  • Given the PatronTypeService calls determinePatronType

  • When no patron type can be found and a NoPatronTypeMappingFoundException isn’t thrown

  • Then DCB throws a PatronTypeMappingNotFound :

PatronTypeMappingNotFound("No mapping found from ptype " + requesterHostLmsCode + ":" + requesterPatronType + " to " + supplierHostLmsCode + " because " + cause.getMessage())

 

  • Given the PatronTypeService calls determinePatronType

  • When the return chain completes with empty

  • Then DCB throws a PatronTypeMappingNotFound :

PatronTypeMappingNotFound("No mapping found from ptype " + requesterHostLmsCode + ":" + requesterPatronType + " to " + supplierHostLmsCode)

 

Additional notes:

  • supplierPreflight exceptions are not mentioned

  • placeHoldRequestAtSupplyingAgency exceptions are not mentioned

  • findVirtualPatron exceptions are not mentioned

Operated as a Community Resource by the Open Library Foundation