Skip to content

Commit cbe5800

Browse files
move error handling to another branch
1 parent 4c6febe commit cbe5800

1 file changed

Lines changed: 26 additions & 36 deletions

File tree

resources/js/components/organisms/OImagery.vue

Lines changed: 26 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ let requestedAnimationFrame;
264264
265265
this.setInitialEngineProps();
266266
this.updateLogoWidth();
267-
this.draw().catch(this.logDebugError);
267+
this.draw().catch(console.debug);
268268
});
269269
},
270270
@@ -274,12 +274,6 @@ let requestedAnimationFrame;
274274
},
275275
276276
methods: {
277-
logDebugError(error) {
278-
if (!process.env.NODE_ENV || process.env.NODE_ENV === 'development') {
279-
console.debug(error);
280-
}
281-
},
282-
283277
setInitialEngineProps() {
284278
const engine = this.engine;
285279
@@ -338,12 +332,8 @@ let requestedAnimationFrame;
338332
339333
if (requestedAnimationFrame) {
340334
window.cancelAnimationFrame(requestedAnimationFrame);
341-
// Only reject if it's not a repaint cancellation
342-
const promise = this.drawPromises.get(requestedAnimationFrame);
343-
if (promise) {
344-
promise.reject(new Error('Repaint cancelled'));
345-
this.drawPromises.delete(requestedAnimationFrame);
346-
}
335+
this.drawPromises.get(requestedAnimationFrame)?.reject(new Error('Repaint cancelled.'));
336+
this.drawPromises.delete(requestedAnimationFrame);
347337
}
348338
349339
const drawFn = (resolve) => {
@@ -539,102 +529,102 @@ let requestedAnimationFrame;
539529
watch: {
540530
logoImage(value) {
541531
this.engine.logoImage = value;
542-
this.draw().catch(this.logDebugError);
532+
this.draw().catch(console.debug);
543533
},
544534
logoType(value) {
545535
this.engine.logoType = value;
546536
this.updateLogoWidth();
547-
this.draw().catch(this.logDebugError);
537+
this.draw().catch(console.debug);
548538
},
549539
styleSet(value) {
550540
this.engine.styleSet = value;
551-
this.draw().catch(this.logDebugError);
541+
this.draw().catch(console.debug);
552542
},
553543
format(value) {
554544
this.engine.format = value;
555-
this.draw(true).catch(this.logDebugError);
545+
this.draw(true).catch(console.debug);
556546
},
557547
visibleHeight(value) {
558548
this.engine.bleed = this.bleed;
559549
this.engine.visibleHeight = value;
560550
this.updateLogoWidth();
561-
this.draw().catch(this.logDebugError);
551+
this.draw().catch(console.debug);
562552
},
563553
visibleWidth(value) {
564554
this.engine.bleed = this.bleed;
565555
this.engine.visibleWidth = value;
566556
this.updateLogoWidth();
567-
this.draw().catch(this.logDebugError);
557+
this.draw().catch(console.debug);
568558
},
569559
canvasHeight(value) {
570560
this.canvas.height = value;
571-
this.draw(true).catch(this.logDebugError);
561+
this.draw(true).catch(console.debug);
572562
},
573563
canvasWidth(value) {
574564
this.canvas.width = value;
575-
this.draw(true).catch(this.logDebugError);
565+
this.draw(true).catch(console.debug);
576566
},
577567
backgroundType(value) {
578568
this.engine.backgroundType = value;
579-
this.draw().catch(this.logDebugError);
569+
this.draw().catch(console.debug);
580570
},
581571
backgroundImage(value) {
582572
this.engine.backgroundImage = value;
583-
this.draw().catch(this.logDebugError);
573+
this.draw().catch(console.debug);
584574
},
585575
backgroundZoom(value) {
586576
this.engine.backgroundZoom = value;
587-
this.draw().catch(this.logDebugError);
577+
this.draw().catch(console.debug);
588578
},
589579
backgroundWatermarkText(value) {
590580
this.engine.backgroundWatermarkText = value;
591-
this.draw().catch(this.logDebugError);
581+
this.draw().catch(console.debug);
592582
},
593583
bars(value) {
594584
this.engine.bars = value;
595-
this.draw(true).catch(this.logDebugError);
585+
this.draw(true).catch(console.debug);
596586
},
597587
fontSizePercent(value) {
598588
this.engine.fontSizePercent = value;
599-
this.draw().catch(this.logDebugError);
589+
this.draw().catch(console.debug);
600590
},
601591
hasTopShadow(value) {
602592
this.engine.topShadow = value;
603-
this.draw().catch(this.logDebugError);
593+
this.draw().catch(console.debug);
604594
},
605595
hasBottomShadow(value) {
606596
this.engine.bottomShadow = value;
607-
this.draw().catch(this.logDebugError);
597+
this.draw().catch(console.debug);
608598
},
609599
hasBorder(value) {
610600
this.engine.hasBorder = value;
611-
this.draw().catch(this.logDebugError);
601+
this.draw().catch(console.debug);
612602
},
613603
copyrightText() {
614604
this.setCopyrightText();
615-
this.draw().catch(this.logDebugError);
605+
this.draw().catch(console.debug);
616606
},
617607
alignment(value) {
618608
this.engine.alignment = value;
619-
this.draw().catch(this.logDebugError);
609+
this.draw().catch(console.debug);
620610
},
621611
fontsLoaded() {
622-
this.draw(true).catch(this.logDebugError);
612+
this.draw(true).catch(console.debug);
623613
},
624614
mousePos() {
625615
this.engine.mousePos = this.mousePos;
626-
this.draw().catch(this.logDebugError);
616+
this.draw().catch(console.debug);
627617
},
628618
dragging() {
629619
this.engine.dragging = this.dragging;
630-
this.draw().catch(this.logDebugError);
620+
this.draw().catch(console.debug);
631621
},
632622
previewDims(value) {
633623
this.engine.previewDims = value;
634624
},
635625
bleed(value) {
636626
this.engine.bleed = value;
637-
this.draw().catch(this.logDebugError);
627+
this.draw().catch(console.debug);
638628
},
639629
}
640630
}

0 commit comments

Comments
 (0)