Exemple #1
0
 def __init__(self,
              message,
              field_name=None,
              data=None,
              valid_data=None,
              **kwargs):
     # pylint: disable=super-init-not-called
     # ValidationError.__init__ is called manually instead of calling super,
     # as the signatures of ValidationError and QiskitError constructors
     # differ.
     ValidationError.__init__(self, message, field_name, data, valid_data,
                              **kwargs)
     self.message = str(message)
 def __init__(self,
              message,
              field_name=SCHEMA,
              data=None,
              valid_data=None,
              **kwargs):
     ValidationError.__init__(self, message, field_name, data, valid_data,
                              **kwargs)
     result_list = []
     flat_dict = flatten(self.messages)
     for parameter, errors in flat_dict.items():
         parameter = tuple(str(s) for s in parameter)
         result_list.append({
             "parameter": '.'.join(parameter),
             "errors": errors
         })
     self.formatted_messages = {"messages": result_list}
Exemple #3
0
 def __init__(self, message, *args, **kwargs):
     status_code = kwargs.pop('status_code', 400)
     WebargsValidationError.__init__(self, message, status_code=status_code)
     MarshmallowValidationError.__init__(self, message, *args, **kwargs)