Reject promise with TypeError for network failures.
Merge pull request #36 from github/reject-with-error

Reject promise with TypeError for network failures.