break;
}
String msg = "The output file(s): " + filename
+ " already exists";
msgCollector.collect(msg, MessageType.Error) ;
throw new PlanValidationException(msg, errCode, errSrc);
}
} catch (PlanValidationException pve) {
throw pve;
} catch (IOException ioe) {
byte errSrc = pigCtx.getErrorSource();
int errCode = 0;
switch(errSrc) {
case PigException.BUG:
errCode = 2003;
break;
case PigException.REMOTE_ENVIRONMENT:
errCode = 6001;
break;
case PigException.USER_ENVIRONMENT:
errCode = 4001;
break;
}
String msg = "Cannot read from the storage where the output "
+ filename + " will be stored ";
msgCollector.collect(msg, MessageType.Error) ;
throw new PlanValidationException(msg, errCode, errSrc, ioe);
} catch (Exception e) {
int errCode = 2116;
String msg = "Unexpected error. Could not check for the existence of the file(s): " + filename;
msgCollector.collect(msg, MessageType.Error) ;
throw new PlanValidationException(msg, errCode, PigException.BUG, e);
}
}