From 62de3e7b9276c5378f90137631cd5d9d8860dc1b Mon Sep 17 00:00:00 2001 From: Rich Greenhill Date: Sat, 17 Sep 2016 20:27:25 +0000 Subject: [PATCH] add descriptive error if no app passed to request --- lib/request.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/request.js b/lib/request.js index e87c8e9..f6c7ec7 100644 --- a/lib/request.js +++ b/lib/request.js @@ -248,6 +248,9 @@ function Test (app, method, path) { util.inherits(Test, Request); function serverAddress (app, path) { + if (!app) { + throw new Error("You must pass a valid application or server into the request"); + } if ('string' === typeof app) { return app + path; }