Skip to content

Commit

Permalink
fix: errors are logged not echoed
Browse files Browse the repository at this point in the history
Test plan:
    - navigate to Aspen Administration > EBSCO EDS >
    Settings
    - create a new Setting, make sure to use invalid
    credentials and save
    - navigate to Aspen Administration > Primary
    Configuration > Library Systems and select your
    current Library
    - set its EDS Setting to the setting you just
    created
    - log out
    - run a search in Articles and Databases

Before this commit:
An error message appears at the top of the screen.
This message contains the information sent back by
EDS.

After this commit:
The error message does not show on screen anymore
and is logged instead.
  • Loading branch information
Chloe070196 committed Oct 11, 2024
1 parent 252709c commit ccea91a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions code/web/sys/SearchObject/EbscoEdsSearcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ public function getCurlConnection() {
}

public function authenticate() {
global $logger;
if (SearchObject_EbscoEdsSearcher::$authenticationToken == null) {
global $library;
$settings = $this->getSettings();
Expand Down Expand Up @@ -185,12 +186,12 @@ public function authenticate() {
//echo("Authenticated in EDS!");
return true;
} elseif ($createSessionResponse->ErrorDescription) {
echo("create session failed, " . print_r($createSessionResponse));
$logger->log("create session failed, " . print_r($createSessionResponse, true), Logger::LOG_WARNING);
return new AspenError("Error processing search in EBSCO EDS");
}
}
} else {
echo("Authentication failed!, $return");
$logger->log("Error processing search in EBSCO EDS: " . print_r($return, true), Logger::LOG_WARNING);
return new AspenError("Error processing search in EBSCO EDS: Authentication failed");
}
} else {
Expand Down

0 comments on commit ccea91a

Please sign in to comment.