feat: error handling for setup / render / watch / event handlers

This commit is contained in:
Evan You
2019-08-30 15:05:39 -04:00
parent 1d55b368e8
commit 966d7b5487
11 changed files with 219 additions and 72 deletions

View File

@@ -27,6 +27,10 @@ export function warn(msg: string, ...args: any[]) {
if (!trace.length) {
return
}
// avoid spamming test output
if (typeof process !== 'undefined' && process.env.NODE_ENV === 'test') {
return
}
if (trace.length > 1 && console.groupCollapsed) {
console.groupCollapsed('at', ...formatTraceEntry(trace[0]))
const logs: string[] = []