Further fixes; improve error handling

This commit is contained in:
Ingvar Stepanyan
2021-08-06 13:48:08 +00:00
parent a9accb2e4e
commit 8600639023
6 changed files with 56 additions and 28 deletions

View File

@@ -1,4 +1,5 @@
import { h, Component, createRef } from 'preact';
import { rethrowIfCritical } from './ops.js';
export const isDebug = new URLSearchParams(location.search).has('debug');
@@ -87,8 +88,9 @@ export class Preview extends Component {
updateCanvasSize();
}
canvasCtx.transferFromImageBitmap(img);
} catch (error) {
console.error(error);
} catch (err) {
rethrowIfCritical(err);
console.error('Could not refresh preview:', err);
}
await new Promise(resolve => requestAnimationFrame(resolve));
this.stats?.update();