utils.isObject(error) would be better.