Skip to content

Commit e94816d

Browse files
author
Eran Hammer
committed
Restore full uri in error message. Closes hapijs#2246
1 parent 30df1bc commit e94816d

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

lib/plugin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ internals.Plugin.prototype.register = function (plugins /*, [options], callback
226226

227227
for (var i = 0, il = selection.connections.length; i < il; ++i) {
228228
var connection = selection.connections[i];
229-
Hoek.assert(item.multiple || !connection._registrations[item.name], 'Plugin', item.name, 'already registered in:', connection.info.host + ':' + connection.settings.port);
229+
Hoek.assert(item.multiple || !connection._registrations[item.name], 'Plugin', item.name, 'already registered in:', connection.info.uri);
230230
connection._registrations[item.name] = item;
231231
}
232232

lib/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ internals.Server.prototype.start = function (callback) {
138138
var connection = dependency.connections[s];
139139
for (var d = 0, dl = dependency.deps.length; d < dl; ++d) {
140140
var dep = dependency.deps[d];
141-
Hoek.assert(connection._registrations[dep], 'Plugin', dependency.plugin, 'missing dependency', dep, 'in connection:', connection.info.host + ':' + connection.settings.port);
141+
Hoek.assert(connection._registrations[dep], 'Plugin', dependency.plugin, 'missing dependency', dep, 'in connection:', connection.info.uri);
142142
}
143143
}
144144
}

test/plugin.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ describe('Plugin', function () {
321321
expect(function () {
322322

323323
server.register(test, function (err) { });
324-
}).to.throw('Plugin test already registered in: example.com:0');
324+
}).to.throw('Plugin test already registered in: http://example.com');
325325

326326
done();
327327
});
@@ -1214,7 +1214,7 @@ describe('Plugin', function () {
12141214
expect(function () {
12151215

12161216
server.start();
1217-
}).to.throw('Plugin test missing dependency none in connection: ' + Os.hostname() + ':0');
1217+
}).to.throw('Plugin test missing dependency none in connection: ' + server.info.uri);
12181218
done();
12191219
});
12201220
});
@@ -1228,7 +1228,7 @@ describe('Plugin', function () {
12281228
expect(function () {
12291229

12301230
server.start();
1231-
}).to.throw('Plugin deps1 missing dependency deps2 in connection: localhost:80');
1231+
}).to.throw('Plugin deps1 missing dependency deps2 in connection: http://localhost:80');
12321232
done();
12331233
});
12341234
});
@@ -1300,7 +1300,7 @@ describe('Plugin', function () {
13001300
expect(function () {
13011301

13021302
server.start();
1303-
}).to.throw('Plugin b missing dependency c in connection: localhost:80');
1303+
}).to.throw('Plugin b missing dependency c in connection: http://localhost:80');
13041304
done();
13051305
});
13061306
});

0 commit comments

Comments
 (0)