Skip to content

Commit

Permalink
Added ref to sumo issue
Browse files Browse the repository at this point in the history
  • Loading branch information
HansKallekleiv committed Feb 10, 2025
1 parent 77a60f3 commit 96cc6d4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions backend_py/primary/primary/services/sumo_access/_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ class SynchronousMethodCallError(Exception):


class FakeHTTPXClient:
"""A fake HTTPX client to ensure we use async methods instead of sync ones."""
"""A fake HTTPX client to ensure we use async methods instead of sync ones.
This is needed as we do not want to allow any synchronous HTTP calls in the primary service.
Ideally this should be handled by the SumoClient. https://github.com/equinor/fmu-sumo/issues/369"""

def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=unused-argument
self._error_msg = "🚫 Do not use a synchronious http class!. Use the async http class instead. "
self._error_msg = "🚫 Do not use a synchronous http class!. Use the async http class instead. "

def __getattr__(self, name: str) -> None:
"""Catch any synchronous method calls and raise a helpful error."""
Expand Down

0 comments on commit 96cc6d4

Please sign in to comment.