Closed matthewp closed 6 years ago
Here's the plan on the design:
errorFormat.html(parts) -> HTML
will give us back the HTML.errorFormat.console(parts) -> Text
will give us formatted Text that can be logged to the console.Usage like this:
const errorFormat = require("donejs-error-format");
app.use(function(err, req, res, next){
let parts = errorFormat.extract(err);
let html = errorFormat.html(parts);
// TODO format the console version, clear, and log
res.type('html').end(html);
});
This was done in #102
Currently errors are forwarded to the client as text. Since this is a development tool we should do a better job of designing these.