diff --git a/openff/bespokefit/executor/services/fragmenter/app.py b/openff/bespokefit/executor/services/fragmenter/app.py index f37d3338..114bdf6a 100644 --- a/openff/bespokefit/executor/services/fragmenter/app.py +++ b/openff/bespokefit/executor/services/fragmenter/app.py @@ -3,6 +3,7 @@ from fastapi import APIRouter from fastapi.responses import Response from openff.fragmenter.fragment import FragmentationResult +from openff.utilities import MissingOptionalDependencyError from openff.bespokefit.executor.services import current_settings from openff.bespokefit.executor.services.fragmenter import worker @@ -95,7 +96,7 @@ def get_fragment_image(fragmentation_id: str, fragment_id: int) -> Response: image_width=200, image_height=200, ) - except ModuleNotFoundError: + except (ModuleNotFoundError, MissingOptionalDependencyError): from openff.fragmenter.depiction import _rd_render_fragment svg_content = _rd_render_fragment(