mirror of
https://github.com/clearml/clearml
synced 2025-04-15 21:12:54 +00:00
Fix validation error causes infinite loop
This commit is contained in:
parent
8c50f34f8c
commit
13a1472b68
@ -2,6 +2,7 @@ import abc
|
|||||||
|
|
||||||
import requests.exceptions
|
import requests.exceptions
|
||||||
import six
|
import six
|
||||||
|
import jsonschema
|
||||||
|
|
||||||
from ..backend_api import Session, CallResult
|
from ..backend_api import Session, CallResult
|
||||||
from ..backend_api.session.session import MaxRequestSizeError
|
from ..backend_api.session.session import MaxRequestSizeError
|
||||||
@ -15,6 +16,10 @@ from ..debugging import get_logger
|
|||||||
from .session import SendError, SessionInterface
|
from .session import SendError, SessionInterface
|
||||||
|
|
||||||
|
|
||||||
|
class ValidationError(ValueError):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
class InterfaceBase(SessionInterface):
|
class InterfaceBase(SessionInterface):
|
||||||
""" Base class for a backend manager class """
|
""" Base class for a backend manager class """
|
||||||
_default_session = None
|
_default_session = None
|
||||||
@ -78,6 +83,15 @@ class InterfaceBase(SessionInterface):
|
|||||||
if raise_on_errors:
|
if raise_on_errors:
|
||||||
raise
|
raise
|
||||||
res = None
|
res = None
|
||||||
|
except jsonschema.ValidationError as e:
|
||||||
|
if log:
|
||||||
|
log.error(
|
||||||
|
'Field %s contains illegal schema: %s', '.'.join(e.path), str(e.message)
|
||||||
|
)
|
||||||
|
if raise_on_errors:
|
||||||
|
raise ValidationError(f"Field {'.'.join(e.path)} contains illegal schema: {e.message}")
|
||||||
|
# We do not want to retry
|
||||||
|
return None
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
res = None
|
res = None
|
||||||
if log and num_retries >= cls._num_retry_warning_display:
|
if log and num_retries >= cls._num_retry_warning_display:
|
||||||
|
Loading…
Reference in New Issue
Block a user