Closed nfantone closed 8 years ago
This is meant to simplify the current API and offer an alternative to the preFormat, format, postFormat functions, which may be confusing some users.
preFormat
format
postFormat
In addition to allow passing an options object, we may benefit from receiving a single function instead which should behave as a shorthand for:
options
function
let opts = { format: (err) => { let obj = {}; // Modify `obj` in any way return obj; } } app.use(error(opts));
So, the above should be equivalent to:
function formatError(err) { let obj = {}; // Modify `obj` in any way return obj; } app.use(error(formatError));
Docs should also be updated.
Implemented in 3.1.0.
3.1.0
This is meant to simplify the current API and offer an alternative to the
preFormat
,format
,postFormat
functions, which may be confusing some users.In addition to allow passing an
options
object, we may benefit from receiving a singlefunction
instead which should behave as a shorthand for:So, the above should be equivalent to:
Docs should also be updated.