refactor(core): suppress mask/highlight errors instead of failing the run
Visual feedback failures (showMask, hideMask, cleanUpHighlights) are non-critical; log them instead of aborting the task or masking the original error during teardown.
This commit is contained in:
@@ -129,3 +129,15 @@ export function assert(condition: unknown, message?: string, silent?: boolean):
|
||||
throw new Error(errorMessage)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Suppress errors from a function.
|
||||
*/
|
||||
export function suppress<T>(fn: () => T): T | undefined {
|
||||
try {
|
||||
return fn()
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
return undefined
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user