Exemple #1
0
 def __init__(self, data: dict):
     try:
         valid_data = self.__schema__(unknown=EXCLUDE).load(data)
     except ValidationError as error:
         raise ApiValidationException(error.messages)
     else:
         self._import(valid_data)
Exemple #2
0
 def __init__(self, data: dict):
     try:
         valid_data = self.__schema__(unknown=EXCLUDE).load(data)
     except ValidationError as error:
         raise ApiValidationException(error.messages)
     except Exception:
         pass  # write to log file if error that we dont know
     else:
         self._import(valid_data)