Fixed error handling in enhanced task getObject method.