tls: throw an error, not string
authorJackson Tian <shyvo1987@gmail.com>
Fri, 1 Aug 2014 06:08:52 +0000 (14:08 +0800)
committerFedor Indutny <fedor@indutny.com>
Fri, 1 Aug 2014 14:10:15 +0000 (18:10 +0400)
Reviewed-By: Fedor Indutny <fedor@indutny.com>
lib/_tls_wrap.js

index cfe2c3e..48cbbf8 100644 (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('^' +