+ my $database = $self->{database};
+
+ if ( $mech->content =~ m{Requested library is unavailable at the moment} ) {
+ warn "ERROR: default database not available, try to swith to $database\n";
+ $self->save_content;
+ $mech->follow_link( url_regex => qr/local_base=$database/i );
+ diag "re-try advanced search";
+ $mech->follow_link( url_regex => qr/find-c/ );
+ }
+
+diag "submit search [$query] on ", $self->{database};
+