diff --git a/emgapi/metagenomics_exchange.py b/emgapi/metagenomics_exchange.py index ca17011aa..6c9103aed 100644 --- a/emgapi/metagenomics_exchange.py +++ b/emgapi/metagenomics_exchange.py @@ -106,7 +106,11 @@ def add_analysis(self, mgya: str, sequence_accession: str): The response object from the API request. """ data = self.generate_metadata(mgya, sequence_accession) - response = self.post_request(endpoint="datasets", data=data) + try: + response = self.post_request(endpoint="datasets", data=data) + except HTTPError as http_error: + logging.exception(f"POST request failed. HTTP Error: {http_error}") + raise http_error return response def check_analysis(self, mgya: str, sequence_accession: str, metadata=None):