Better error handling.
Merge pull request #65 from kentaro/error-handling

Better error handling.