Skip to content

Commit

Permalink
Add missingoptionaldependencyerror to try/except in fragmenter app.py
Browse files Browse the repository at this point in the history
  • Loading branch information
j-wags committed Oct 12, 2023
1 parent 13f584c commit 499261a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion openff/bespokefit/executor/services/fragmenter/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 499261a

Please sign in to comment.