From 1b373b26ff13892176f2f33d0f7a93471a743802 Mon Sep 17 00:00:00 2001 From: buzz-lightsnack-2007 <73412182+buzz-lightsnack-2007@users.noreply.github.com> Date: Mon, 13 May 2024 14:34:45 +0800 Subject: [PATCH] Correct the syntax problem leading to only the stack being saved during an error --- scripts/external/processor.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/scripts/external/processor.js b/scripts/external/processor.js index fe936b1..54661da 100644 --- a/scripts/external/processor.js +++ b/scripts/external/processor.js @@ -77,11 +77,13 @@ export default class processor { this.product.save(); } catch(err) { // Use the existing error, if any exists. - (this.status.error) ? false : - [`name`, `message`, `stack`].forEach((KEY) => { - this.status.error = err[KEY]; - }); - + if (!this.status.error) { + this.status.error = {}; + [`name`, `message`, `stack`].forEach((KEY) => { + this.status.error[KEY] = err[KEY]; + }); + } + // Display the error. this.#notify(-1); };