Attempt to fix display of error by setting to string

This commit is contained in:
buzz-lightsnack-2007 2024-05-07 10:07:04 +08:00
parent 569030df1a
commit 1370cd6624

View file

@ -32,7 +32,12 @@ export default class processor {
await this.product.analyze();
} catch(err) {
logging.error(err.name, err.message, err.stack, false);
this.product.status[`error`] = err;
// Convert the error to an object.
this.product.status[`error`] = {};
[`name`, `message`, `stack`].forEach((KEY) => {
this.product.status.error[KEY] = String(err[KEY]);
})
};
// Indicate that the process is done.