Skip to content

Commit

Permalink
handle hlint error and the no suggestions message
Browse files Browse the repository at this point in the history
  • Loading branch information
JPMoresmau committed Mar 5, 2012
1 parent deba3d1 commit 60146a1
Show file tree
Hide file tree
Showing 6 changed files with 533 additions and 106 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import java.io.StringReader;
import java.io.StringWriter;
import java.io.Writer;
import java.util.ArrayList;
import java.util.List;

Expand All @@ -15,6 +14,7 @@
import net.sf.eclipsefp.haskell.util.ProcessRunner;

import org.eclipse.core.runtime.IPath;
import org.eclipse.osgi.util.NLS;

/**
* Class the encapsulates the logic of calling hlint and
Expand All @@ -28,9 +28,9 @@
public class HLintRunner {

public List<Suggestion> run(IPath path) {
StringWriter err=new StringWriter();
try {
StringWriter out=new StringWriter();
Writer err=new StringWriter();
String exe=HLintPlugin.getHlintPath();
if (exe==null || exe.length()==0){
exe="hlint"; // hope it's in the path
Expand All @@ -40,7 +40,7 @@ public List<Suggestion> run(IPath path) {
OutputParser parser = new OutputParser(new StringReader(out.toString()));
return parser.suggestions();
} catch (Throwable ex) {
HLintPlugin.logError(HLintText.error_run, ex);
HLintPlugin.logError(NLS.bind(HLintText.error_run,err.toString()), ex);
}
return new ArrayList<Suggestion>();
}
Expand Down
Loading

0 comments on commit 60146a1

Please sign in to comment.