Skip to content

Commit

Permalink
update for exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexPatrie committed Sep 1, 2024
1 parent 12f070e commit bddfe70
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 14 deletions.
2 changes: 1 addition & 1 deletion bio_compose/_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.4.2
0.4.3
16 changes: 14 additions & 2 deletions bio_compose/verifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,20 @@ def get_rmse(self, job_id: str) -> dict:
Returns:
A dictionary mapping of simulator names to their respective root-mean-square error scores.
"""
output = self.get_output(job_id=job_id)
return output['content'].get('results').get('rmse') or {}
try:
output = self.get_output(job_id=job_id)
return output['content'].get('results').get('rmse') or {}
except Exception as e:
import traceback
tb_str = traceback.format_exc()
error_message = (
f"An unexpected error occurred while processing your request:\n"
f"Error Type: {type(e).__name__}\n"
f"Error Details: {str(e)}\n"
f"Traceback:\n{tb_str}"
)

return {'error': error_message}

def get_compatible(self, file: str, versions: bool = False) -> Union[List[Tuple[Any, ...]], RequestError]:
"""
Expand Down
Loading

0 comments on commit bddfe70

Please sign in to comment.