Skip to content

General Exception handling for /compute/output/{task_id} #92

@coltonbh

Description

@coltonbh

Update 2025-02-08

I need to more robustly handle exceptions in this endpoint.

CASES:

  1. When a qcop exception does not have e.program_output. E.g., when requesting a TeraChem calculation but TeraChem isn't available in BigChem. fr.get() raises a qcop.exceptions.ProgramNotFoundError but e.program_output is None. So None gets returned to the client as the "result."
  2. Non qcop exceptions such as a parser error. I guess this has more to do with qcop properly wrapping up qcparse errors.

I need to either capture ALL exceptions in qcop and append a .program_output object to them, or handle this some other way. I don't love depending on lower packages to not have 500 errors in this endpoint, but otherwise it's a bit hard (impossibel?) to construct a program_output object for the end user because I don't get have the .input_data unless it's passed up by the underlying programs.

Exceptions raised in qcop, e.g., sending a "transition_state" calculation to "psi4" which doesn't support it will result in 500 errors because I don't generically handle exceptions on this endpoint.

The issue is that in qcop I choose to raise certain exceptions upfront before the program is ever called and do not create exc.program_failure objects for them. So these exceptions get raised in ChemCloud and I do not have the associated .input_data to create a proper ProgramFailure objects.

I think the best fix will be to handle ALL exceptions in qcop the same way and append a .program_failure object to them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions