Show better error for "wrong" objects in HashArray

The error message now includes the actual type of the object,
not just the expected class. This is intended to help us track
down https://bugzilla.wikimedia.org/show_bug.cgi?id=71479