spegling av
https://github.com/therootcompany/greenlock-express.js.git
synced 2026-10-31 05:24:55 +00:00
improve error message
This commit is contained in:
förälder
2ee3c65405
incheckning
3cd1390539
@ -27,7 +27,7 @@ function LEX(obj, app) {
|
||||
}
|
||||
|
||||
obj.debug = LEX.debug;
|
||||
|
||||
|
||||
if ('function' === typeof app) {
|
||||
obj.onRequest = obj.onRequest || app;
|
||||
}
|
||||
@ -162,6 +162,10 @@ function LEX(obj, app) {
|
||||
}
|
||||
|
||||
function listen(plainPorts, tlsPorts, onListening) {
|
||||
if (plainPorts && (!Array.isArray(plainPorts) || !Array.isArray(tlsPorts))) {
|
||||
throw new Error(".listen() must be used with plain and tls port arrays, like this: `.listen([80], [443, 5001], function () {})`");
|
||||
}
|
||||
|
||||
var results = {
|
||||
plainServers: []
|
||||
, tlsServers: []
|
||||
|
||||
Laddar…
x
Referens i nytt ärende
Block a user