motion
Version:
motion - moving development forward
18 lines (13 loc) • 417 B
JavaScript
export default function reportError(...args) {
if (process.env.production) return
if (!root.motionRuntimeError) return
let err = args
// if coming from catch
if (typeof args[0] == 'object') {
let lines
if (args[0].stack)
lines = args[0].stack.split("\n")
err = [args[0].message, lines && lines[1] || args[0].fileName || '', 0, 0, args[0].stack]
}
root.motionRuntimeError(...err)
}