Skip to content
This repository has been archived by the owner on May 16, 2024. It is now read-only.

Commit

Permalink
Check err before reading res. Fixes #186.
Browse files Browse the repository at this point in the history
Generated javascript
  • Loading branch information
benweet committed Jul 6, 2015
1 parent cde449d commit 4381368
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion lib/octonode/auth.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/octonode/gist.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion src/octonode/auth.coffee
Expand Up @@ -88,7 +88,9 @@ auth = module.exports =
'Content-Type': 'application/x-www-form-urlencoded'
'User-Agent': 'octonode/0.3 (https://github.com/pksunkara/octonode) terminal/0.0'
, (err, res, body) ->
if res.statusCode is 404
if err?
callback err
else if res.statusCode is 404
callback(new Error('Access token not found'))
else
body = qs.parse body
Expand Down

0 comments on commit 4381368

Please sign in to comment.