Correct the syntax problem leading to only the stack being saved during an error

This commit is contained in:
buzz-lightsnack-2007 2024-05-13 14:34:45 +08:00
parent cbbada1b8a
commit 1b373b26ff

View file

@ -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);
};