throw exception if non-object was passed to lwpobj