Skip to content

Commit ef249be

Browse files
committed
Add a better error message for DriverToMapper failure response.
1 parent b1c4b5c commit ef249be

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

hadoop/src/main/java/water/hadoop/h2omapper.java

+6-3
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,12 @@ public String fetchFlatfile() throws Exception {
171171
msg.write(s);
172172
DriverToMapperMessage msg2 = new DriverToMapperMessage();
173173
msg2.read(s);
174-
if (msg2.getType() != DriverToMapperMessage.TYPE_FETCH_FLATFILE_RESPONSE) {
175-
Log.err("DriverToMapperMessage type unrecognized");
176-
throw new Exception ("DriverToMapperMessage type unrecognized");
174+
char type = msg2.getType();
175+
if (type != DriverToMapperMessage.TYPE_FETCH_FLATFILE_RESPONSE) {
176+
int typeAsInt = (int)type & 0xff;
177+
String str = new String("DriverToMapperMessage type unrecognized (" + typeAsInt + ")");
178+
Log.err(str);
179+
throw new Exception (str);
177180
}
178181
s.close();
179182
String flatfile = msg2.getFlatfile();

0 commit comments

Comments
 (0)