You would expect these usages to log identically:
import createError from 'http-errors'
console.log(
JSON.stringify(createError('Message 1.')),
JSON.stringify(createError(new Error('Message 2.')))
)
They actually output this:
{"message":"Message 1."} {"expose":false,"statusCode":500,"status":500}
For context, I am attempting to do snapshot testing of errors that have been created various ways and am having many surprises.