The function comparePdfByImage in ./functions/compareImage.js has no try catch block so any promise rejections by await calls to imageEngine.* are not caught
I would add a try catch block inside the ..new Promise and either reject the error or resolve it with a failed status
const comparePdfByImage = async (compareDetails) => {
return new Promise(async (resolve, reject) => {
try {
..... // original code block
.....
.....
.....
} catch (error) {
// reject or resolve it with failed status
reject(error);
resolve({ status: 'failed', error: error });
}
});
The function comparePdfByImage in ./functions/compareImage.js has no try catch block so any promise rejections by await calls to imageEngine.* are not caught
I would add a try catch block inside the ..new Promise and either reject the error or resolve it with a failed status