tls: throw an error, not string

Reviewed-By: Fedor Indutny <fedor@indutny.com>
This commit is contained in:
Jackson Tian
2014-08-01 14:08:52 +08:00
committed by Fedor Indutny
parent d287b8e58a
commit bbb2dccd1b

View File

@@ -738,7 +738,7 @@ Server.prototype.setOptions = function(options) {
// SNI Contexts High-Level API
Server.prototype.addContext = function(servername, context) {
if (!servername) {
throw 'Servername is required parameter for Server.addContext';
throw new Error('Servername is required parameter for Server.addContext');
}
var re = new RegExp('^' +