Skip to content

Commit

Permalink
Merge pull request #3545 from open-formulieren/issue/3540-raw-exception
Browse files Browse the repository at this point in the history
🩹 Raise a custom exception instead of `RuntimeError`
  • Loading branch information
sergei-maertens authored Oct 19, 2023
2 parents ed2145d + 9e3e911 commit 953245a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/openforms/appointments/contrib/qmatic/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ class BranchDetailDict(TypedDict):
updated: int


class NoServiceConfigured(RuntimeError):
pass


# API CLIENT IMPLEMENTATIONS, per major version of the API


Expand All @@ -73,7 +77,7 @@ def QmaticClient() -> "Client":
config = QmaticConfig.get_solo()
assert isinstance(config, QmaticConfig)
if (service := config.service) is None:
raise RuntimeError("No Qmatic service defined, aborting!")
raise NoServiceConfigured("No Qmatic service defined, aborting!")
assert isinstance(service, Service)
service_client_factory = ServiceClientFactory(service)
return Client.configure_from(service_client_factory)
Expand Down

0 comments on commit 953245a

Please sign in to comment.