Repository: climate Updated Branches: refs/heads/master 705403a03 -> fc61608a9
CLIMATE-817 - More informative error messages for data_source.load_file() Project: http://git-wip-us.apache.org/repos/asf/climate/repo Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/fc61608a Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/fc61608a Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/fc61608a Branch: refs/heads/master Commit: fc61608a931da03050925bd629765036559eaf87 Parents: 705403a Author: Alex Goodman <[email protected]> Authored: Thu Jun 23 16:27:24 2016 -0700 Committer: Alex Goodman <[email protected]> Committed: Thu Jun 23 16:27:24 2016 -0700 ---------------------------------------------------------------------- ocw/data_source/local.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/climate/blob/fc61608a/ocw/data_source/local.py ---------------------------------------------------------------------- diff --git a/ocw/data_source/local.py b/ocw/data_source/local.py index 0fa81b1..6d8e61a 100644 --- a/ocw/data_source/local.py +++ b/ocw/data_source/local.py @@ -229,14 +229,14 @@ def load_file(file_path, try: netcdf = netCDF4.Dataset(file_path, mode='r') except IOError: - err = "Dataset filepath is invalid. Please ensure it is correct." + err = "Dataset filepath '%s' is invalid. Please ensure it is correct." %file_path raise ValueError(err) except: err = ( - "The given file cannot be loaded. Either the path is invalid or the given file is invalid. " + "The given file '%s' cannot be loaded. Either the path is invalid or the given file is invalid. " "Please ensure that it is a valid " "NetCDF file. If problems persist, report them to the project's " - "mailing list." + "mailing list." %file_path ) raise ValueError(err)
