mirror of
https://github.com/niklasvh/html2canvas.git
synced 2023-08-10 21:13:10 +03:00
fix: handle unhandled promise rejections (#2568)
This commit is contained in:

committed by
GitHub

parent
382853cb33
commit
4555940d0b
@ -86,6 +86,11 @@ testList
|
||||
throw new Error('Window not found for iframe');
|
||||
}
|
||||
|
||||
contentWindow.addEventListener('unhandledrejection', (event) => {
|
||||
console.error(event.reason);
|
||||
throw new Error(`unhandledrejection: ${JSON.stringify(event.reason)}`);
|
||||
});
|
||||
|
||||
const canvas: HTMLCanvasElement = await contentWindow
|
||||
// @ts-ignore
|
||||
.html2canvas(contentWindow.forceElement || contentWindow.document.documentElement, {
|
||||
|
Reference in New Issue
Block a user