Skip to content

Commit

Permalink
Merge pull request #501 from reconbot/patch-1
Browse files Browse the repository at this point in the history
Make the source of NetConnectNotAllowedError clear
  • Loading branch information
pgte committed Mar 22, 2016
2 parents 1f044b0 + 02c1085 commit 11b4b45
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions README.md
Expand Up @@ -912,8 +912,12 @@ So, if you try to request any host not 'nocked', it will thrown an `NetConnectNo

```js
nock.disableNetConnect();
http.get('http://google.com/');
// this code throw NetConnectNotAllowedError with message:
var req = http.get('http://google.com/');
req.on('error', function(err){
console.log(err);
});
// The returned `http.ClientRequest` will emit an error event (or throw if you're not listening for it)
// This code will log a NetConnectNotAllowedError with message:
// Nock: Not allow net connect for "google.com:80"
```

Expand Down

0 comments on commit 11b4b45

Please sign in to comment.