Handling errors when determining best secondary