Switch more to use IOException.
Remove extra system.out.println
Merge pull request #45 from tonyhuang/errorcode

Switch more to use IOException.