Skip to content

Commit

Permalink
docs: Change error message to be more grammatical
Browse files Browse the repository at this point in the history
I think that `Disallow net connect` makes more sense.
  • Loading branch information
RichardLitt authored and gr2m committed Sep 9, 2018
1 parent cccdbba commit 6a0d74e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/intercept.js
Expand Up @@ -33,7 +33,7 @@ function NetConnectNotAllowedError(host, path) {

this.name = 'NetConnectNotAllowedError';
this.code = 'ENETUNREACH'
this.message = 'Nock: Not allow net connect for "' + host + path + '"';
this.message = 'Nock: Disallowed net connect for "' + host + path + '"';

Error.captureStackTrace(this, this.constructor);
}
Expand Down
4 changes: 2 additions & 2 deletions tests/test_back.js
Expand Up @@ -371,7 +371,7 @@ tap.test('nockBack record tests', function (nw) {
http.get('http://www.amazon.com', function(res) {
throw "should not request this";
}).on('error', function(err) {
t.equal(err.message, 'Nock: Not allow net connect for "www.amazon.com:80/"');
t.equal(err.message, 'Nock: Disallowed net connect for "www.amazon.com:80/"');
done();
t.end();
});
Expand Down Expand Up @@ -459,7 +459,7 @@ tap.test('nockBack lockdown tests', function (nw) {
});

req.on('error', function (err) {
t.equal(err.message.trim(), 'Nock: Not allow net connect for "google.com:80/"');
t.equal(err.message.trim(), 'Nock: Disallowed net connect for "google.com:80/"');
t.end();
});

Expand Down
6 changes: 3 additions & 3 deletions tests/test_intercept.js
Expand Up @@ -3009,7 +3009,7 @@ test('disabled real HTTP request', function(t) {
http.get('http://www.amazon.com', function(res) {
throw "should not request this";
}).on('error', function(err) {
t.equal(err.message, 'Nock: Not allow net connect for "www.amazon.com:80/"');
t.equal(err.message, 'Nock: Disallowed net connect for "www.amazon.com:80/"');
t.end();
});

Expand Down Expand Up @@ -3053,7 +3053,7 @@ test('enable real HTTP request only for google.com, via string', {skip: process.
http.get('http://www.amazon.com', function(res) {
throw "should not deliver this request"
}).on('error', function (err) {
t.equal(err.message, 'Nock: Not allow net connect for "www.amazon.com:80/"');
t.equal(err.message, 'Nock: Disallowed net connect for "www.amazon.com:80/"');
t.end();
});

Expand All @@ -3070,7 +3070,7 @@ test('enable real HTTP request only for google.com, via regexp', {skip: process.
http.get('http://www.amazon.com', function(res) {
throw "should not request this";
}).on('error', function (err) {
t.equal(err.message, 'Nock: Not allow net connect for "www.amazon.com:80/"');
t.equal(err.message, 'Nock: Disallowed net connect for "www.amazon.com:80/"');
t.end();
});

Expand Down
2 changes: 1 addition & 1 deletion tests/test_net_connect.js
Expand Up @@ -11,7 +11,7 @@ test('disable net connect is default', function (t) {

mikealRequest('https://google.com/', function(err, res) {
assert(err);
assert.equal(err.message, 'Nock: Not allow net connect for "google.com:443/"');
assert.equal(err.message, 'Nock: Disallowed net connect for "google.com:443/"');
t.end();
})
});

0 comments on commit 6a0d74e

Please sign in to comment.