Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More descriptive error handling for API calls #59

Open
Kenny-Heitritter opened this issue Jan 24, 2025 · 0 comments
Open

More descriptive error handling for API calls #59

Kenny-Heitritter opened this issue Jan 24, 2025 · 0 comments

Comments

@Kenny-Heitritter
Copy link

There should be better error responses when using cudaq_solvers.create_molecule and any other code that uses API calls to execute code. When executing the following, the user just gets a blanket error that isn't specific about what went wrong on the pyscf call

from cudaq_solvers import create_molecule

xyz = [('H', (0., 0., 0.)), ('H', (1.0, 0., 0.))]
molecule = create_molecule(xyz, 'sto-3sg', 0, 0)
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
Cell In[34], [line 4](vscode-notebook-cell:?execution_count=34&line=4)
      [1](vscode-notebook-cell:?execution_count=34&line=1) from cudaq_solvers import create_molecule
      [3](vscode-notebook-cell:?execution_count=34&line=3) xyz = [('H', (0., 0., 0.)), ('H', (1.0, 0., 0.))]
----> [4](vscode-notebook-cell:?execution_count=34&line=4) molecule = create_molecule(xyz, 'sto-3sg', 0, 0)

RuntimeError: HTTP POST Error - status code 500: : Internal Server Error

when the problem is just that an invalid basis set ('sto-3sg' rather than 'sto-3g') was passed. Similarly, if the xyz is changed such that it is syntactically correct but not what pyscf expects then the error will be the same blanket internal server error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant