Exemple #1
0
    def __conversion_error(self, field_name, value, desired_type):
        """Raises an exception to report the specified conversion error.

        @param field_name: The name of the field that failed to convert.
        @param value: The value that could not be converted.
        @param desired_type: The desired conversion type.

        @raise JsonConversionException: The conversion error."""
        raise JsonConversionException(
            "Failed converting %s of type %s for field %s to desired type %s" %
            (str(value), type(value), field_name, desired_type))
Exemple #2
0
 def __raise_not_json_object(self, index):
     raise JsonConversionException(
         "A non-JsonObject entry was found in array at index=%i" % index)