protected function getChannelUpdates(string $root) : array
{
$state = State::instance();
if (IDE_HACKS) {
$state->hail = new Hail(new Client());
}
foreach ($this->getChannelURLs() as $url) {
$initiated = new \DateTime('now');
$response = $state->hail->postSignedJSON($url . API::get('fetch_keys') . '/' . $root, $this->channelPublicKey);
try {
// We use a separate method for parsing this update:
return $this->parseChannelUpdateResponse($response, $initiated);
} catch (CouldNotUpdate $ex) {
// Log the error message:
$this->log($ex->getMessage(), LogLevel::ALERT, \Airship\throwableToArray($ex));
// continue;
}
}
// When all else fails, TransferException
throw new TransferException(\__("All else has failed."));
}