Improve error trapping when reading gridded datasets