def error(self, obj, name, value):
        """Returns an informative and descriptive error string."""

        wtype = "value"
        wvalue = value
        info = "an array-like object"

        # pylint: disable=E1101
        if self.shape and hasattr(value, 'shape') and value.shape:
            if self.shape != value.shape:
                info += " of shape %s" % str(self.shape)
                wtype = "shape"
                wvalue = str(value.shape)

        vtype = type(value)
        msg = "Variable '%s' must be %s, but a %s of %s (%s) was specified." % \
                               (name, info, wtype, wvalue, vtype)
        try:
            obj.raise_exception(msg, ValueError)
        except __HOLE__:
            raise ValueError(msg)
dataset/ETHPy150Open OpenMDAO/OpenMDAO-Framework/openmdao.main/src/openmdao/main/datatypes/array.py/Array.error