Skip to content

Commit

Permalink
add check for missing solc
Browse files Browse the repository at this point in the history
  • Loading branch information
hayeah committed Jan 2, 2018
1 parent 205ed77 commit 83e590a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions compiler.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,18 @@ func (c *Compiler) execSolc() (*rawCompilerOutput, error) {
cmd := exec.Command("solc", args...)
cmd.Stderr = &stderr
stdout, err := cmd.Output()

if _, hasExitErr := err.(*exec.ExitError); hasExitErr {
return nil, &CompilerError{
SourceFile: filename,
ErrorOutput: stderr.String(),
}
}

if err != nil {
return nil, errors.Wrap(err, "exec")
}

output := &rawCompilerOutput{}
// fmt.Println("solc output", string(stdout))
err = json.Unmarshal(stdout, output)
Expand Down

0 comments on commit 83e590a

Please sign in to comment.