Skip to content

Commit

Permalink
Merge pull request #1276 from UN-OCHA/berliner/HPC-9989
Browse files Browse the repository at this point in the history
HPC-9989: Gracefully handle missing images in CM environments
  • Loading branch information
berliner authored Dec 23, 2024
2 parents 6e1b40c + ed56f50 commit 056c28b
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -463,8 +463,14 @@ public function getFileContent($uri) {
$basic_auth['pass'],
];
}
$response = $this->httpClient->get($uri, $options);
return $response->getBody();
try {
$response = $this->httpClient->get($uri, $options);
return $response->getBody();
}
catch (ClientException $e) {
// The image wasn't found or something similar.
return NULL;
}
}

/**
Expand Down

0 comments on commit 056c28b

Please sign in to comment.