I like the idea of this and would be interested in bringing it into my workflow, but I find Beefy's DOM-based error reporting (using <pre>) to be a bit cleaner and less jarring/disruptive than a modal alert().
There's also more potential for colors, err.stack, etc rather than just a string message.
Are you open to this? Or would you rather it be in another module?
A simple template ends up looking like this: (mostly from Beefy)
function(error) {
console.error(error)
var doc = typeof document === 'undefined' ? null : document
if (!doc)
return
if(!doc.body) {
return doc.addEventListener('DOMContentLoaded', function() {
output()
})
} else
output()
function output() {
var pre = doc.createElement('pre')
pre.textContent = error
if (doc.body.children.length)
doc.body.insertBefore(pre, doc.body.children[0])
else
doc.body.appendChild(pre)
}
}
I like the idea of this and would be interested in bringing it into my workflow, but I find Beefy's DOM-based error reporting (using
<pre>
) to be a bit cleaner and less jarring/disruptive than a modalalert()
.There's also more potential for colors,
err.stack
, etc rather than just a string message.Are you open to this? Or would you rather it be in another module?
A simple template ends up looking like this: (mostly from Beefy)