# to a given library. We look fo that in the AgencyId of the
# BibliographRecordId or in the ToAgencyId of the main message.
my $selection_ou = $self->find_location_failover($bibid->{AgencyId}, $request, $message);
+ unless ($selection_ou) {
+ $problem = NCIP::Problem->new(
+ {
+ ProblemType => 'Unknown Agency',
+ ProblemDetail => 'Agency is not known',
+ ProblemElement => 'BibliographicRecordIdentifier',
+ ProblemValue => $bibid->{AgencyId} || $request->{$message}->{InitiationHeader}->{ToAgencyId}->{AgencyId}
+ }
+ );
+ $response->problem($problem);
+ return $response;
+ }
# We need to see if the bib exists and has a holdable, not deleted
# copy at the selection_ou. If successful, we retun a
my $idvalue = $item_id->{ItemIdentifierValue};
my $itemagy = $item_id->{AgencyId};
my $selection_ou = $self->find_location_failover($itemagy, $request, $message);
+ unless ($selection_ou) {
+ my $problem = NCIP::Problem->new(
+ {
+ ProblemType => 'Unknown Agency',
+ ProblemDetail => 'Agency is not known',
+ ProblemElement => 'AgencyId',
+ ProblemValue => $item_id->{AgencyId} || $request->{$message}->{InitiationHeader}->{ToAgencyId}->{AgencyId}
+ }
+ );
+ $response->problem($problem);
+ return $response;
+ }
+
# We should support looking up holds by barcode, since we still
# support placing them by barcode, but that is not how it is going
# to work with Auto-Graphics, apparently. I'll leave the
$shortname
);
+ # Check for failure from the above.
+ if (ref($aou) eq 'HASH') {
+ undef($aou);
+ }
+
# We want to retrieve the type and manually "flesh" the object.
if ($aou) {
my $type = $U->simplereq(