express-bunyan-logger icon indicating copy to clipboard operation
express-bunyan-logger copied to clipboard

Clearer error message if you use the library incorrectly

Open kevinburke opened this issue 6 years ago • 0 comments

I was incorrectly doing

var bunyanLogger = require("express-bunyan-logger");
var express = require("express");
var app = express();
app.use(bunyanLogger);

when I really wanted:

app.use(bunyanLogger());

It's hard to tell what goes wrong in the first case. The app just hangs and never hits the callback. It would be nice if this library detected if opts was actually an http.IncomingMessage and returned an appropriate error.

kevinburke avatar Aug 01 '17 17:08 kevinburke