[Swift-commit] r3238 - branches/1.0/src/org/griphyn/vdl/karajan/lib

noreply at svn.ci.uchicago.edu noreply at svn.ci.uchicago.edu
Mon Feb 15 22:44:01 CST 2010


Author: hategan
Date: 2010-02-15 22:44:01 -0600 (Mon, 15 Feb 2010)
New Revision: 3238

Modified:
   branches/1.0/src/org/griphyn/vdl/karajan/lib/VDLFunction.java
Log:
throw a nicer exception when trying to invoke filename() and related functions on a primitive (or otherwise lacking a mapper) piece of data

Modified: branches/1.0/src/org/griphyn/vdl/karajan/lib/VDLFunction.java
===================================================================
--- branches/1.0/src/org/griphyn/vdl/karajan/lib/VDLFunction.java	2010-02-12 20:32:49 UTC (rev 3237)
+++ branches/1.0/src/org/griphyn/vdl/karajan/lib/VDLFunction.java	2010-02-16 04:44:01 UTC (rev 3238)
@@ -283,6 +283,9 @@
 			return relativize(String.valueOf(var.getValue()));
 		}
 		else {
+			if (var.getMapper() == null) {
+				throw new ExecutionException("Cannot invoke filename() on data without a mapper: " + var);
+			}
 			PhysicalFormat f = var.getMapper().map(var.getPathFromRoot());
 			if (f instanceof GeneralizedFileFormat) {
 				String filename = ((GeneralizedFileFormat) f).getURIAsString();




More information about the Swift-commit mailing list