Skip to content

redirect error messages and exceptions to STDERR, not STDOUT #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/edu/msu/cme/rdp/classifier/ClassifierCmd.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public void doClassify(String inputFile, String outFile, String propfile, Classi
wt.write(ClassificationResultFormatter.getOutput(result, format));

} catch (ShortSequenceException e) {
System.out.println(e.getMessage());
System.err.println(e.getMessage());
} catch (Exception e) {
e.printStackTrace();
}
Expand Down Expand Up @@ -181,7 +181,7 @@ public static void main(String[] args) throws Exception {
queryFile = args[0];

} catch (Exception e) {
System.out.println("Command Error: " + e.getMessage());
System.err.println("Command Error: " + e.getMessage());
new HelpFormatter().printHelp(120, "ClassifierCmd [options] <samplefile>\nNote this is the legacy command for one sample classification ", "", options, "");

return;
Expand Down
8 changes: 4 additions & 4 deletions src/edu/msu/cme/rdp/classifier/comparison/ComparisonCmd.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public void doClassify(String s1, String s2, String detailFile, String sigFile,
wt.write(ClassificationResultFormatter.getOutput(result, format));

} catch (ShortSequenceException e) {
System.out.println(e.getMessage());
System.err.println(e.getMessage());
} catch (Exception e) {
e.printStackTrace();
}
Expand All @@ -111,7 +111,7 @@ public void doClassify(String s1, String s2, String detailFile, String sigFile,
wt.write(ClassificationResultFormatter.getOutput(result, format));

} catch (ShortSequenceException e) {
System.out.println(e.getMessage());
System.err.println(e.getMessage());
} catch (Exception e) {
e.printStackTrace();
}
Expand Down Expand Up @@ -301,7 +301,7 @@ public static void main(String[] args) throws Exception {
}
}
} catch (Exception e) {
System.out.println("Command Error: " + e.getMessage());
System.err.println("Command Error: " + e.getMessage());
new HelpFormatter().printHelp(120, "ComparisonCmd", "", options, "", true);
return;
}
Expand All @@ -318,4 +318,4 @@ public static void main(String[] args) throws Exception {
cmd.doClassify(queryFile1, queryFile2, class_outputFile, compare_outputFile, format);

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public static void main(String[] args) throws FileNotFoundException,
}

} catch (Exception e) {
System.out.println("Command Error: " + e.getMessage());
System.err.println("Command Error: " + e.getMessage());
new HelpFormatter().printHelp(120, "train", "", options, "", true);
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ private String modifySequence(String s) {
out.close();
return out.toString();
} catch (IOException e) {
System.out.println("In StringReader or StringWriter exception : " + e.getMessage());
System.err.println("In StringReader or StringWriter exception : " + e.getMessage());
}
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ public static void main(String[] args) throws FileNotFoundException, IOException
GoodWordIterator.setWordSize(kmer);
}*/
} catch (Exception e) {
System.out.println("Command Error: " + e.getMessage());
System.err.println("Command Error: " + e.getMessage());
new HelpFormatter().printHelp(120, "LeaveOneOutTesterMain", "", options, "", true);
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/edu/msu/cme/rdp/classifier/utils/HierarchyVersion.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class HierarchyVersion {
try{
versionPattern = Pattern.compile(regex);
} catch(PatternSyntaxException pse){
System.out.println("There is a problem with the regular expression! " + regex);
System.err.println("There is a problem with the regular expression! " + regex);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/edu/msu/cme/rdp/multicompare/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ public static void main(String[] args) throws Exception {
throw new IllegalArgumentException("Require at least one sample files");
}
}catch (Exception e) {
System.out.println("Command Error: " + e.getMessage());
System.err.println("Command Error: " + e.getMessage());
new HelpFormatter().printHelp(80, " [options] <samplefile>[,idmappingfile] ...", "", options, "");
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/edu/msu/cme/rdp/multicompare/Reprocess.java
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ public static void main(String [] args) throws Exception {

}
} catch (Exception e) {
System.out.println("Command Error: " + e.getMessage());
System.err.println("Command Error: " + e.getMessage());
new HelpFormatter().printHelp(120, "Reprocess [options] <Classification_allrank_result>[,idmappingfile] ...", "", options, "");
return;
}
Expand Down