You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How can i efficiently handle cases where an image is not found or does not exist. Right now if an image is not found it basically crashes the server and throws an error.
The below code works fine if an image has been received by the component, else it throws an error.
E:/wamp64/www/ssr-test-project/node_modules/astro-imagetools/api/utils/throwErrorIfUnsupported.js:9
throw new Error(`Failed to load ${src}; Invalid image format`);
^
Error: Failed to load http://209.182.232.71:4025/static/images/tablet/bldog/6-reasons-why-a-career-in.webp; Invalid image format
at Module.throwErrorIfUnsupported [as default] (E:/wamp64/www/ssr-test-project/node_modules/astro-imagetools/api/utils/throwErrorIfUnsupported.js:9:11)
at Module.getResolvedSrc [as default] (E:/wamp64/www/ssr-test-project/node_modules/astro-imagetools/api/utils/getResolvedSrc.js:39:34)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Module.getProcessedImage [as default] (E:/wamp64/www/ssr-test-project/node_modules/astro-imagetools/api/utils/getProcessedImage.js:28:22)
at async __vite_ssr_exports__.default (E:/wamp64/www/ssr-test-project/node_modules/astro-imagetools/api/utils/getImage.js:41:5)
at async Module.renderPicture [as default] (E:/wamp64/www/ssr-test-project/node_modules/astro-imagetools/api/renderPicture.js:54:28)
at async eval (E:/wamp64/www/ssr-test-project/node_modules/astro-imagetools/components/Picture.astro:12:36)
at async AstroComponentInstance.render (E:/wamp64/www/ssr-test-project/node_modules/astro/dist/runtime/server/render/astro/instance.js:44:7)
at async Object.render (E:/wamp64/www/ssr-test-project/node_modules/astro/dist/runtime/server/render/component.js:342:7)
at async Module.renderChild (E:/wamp64/www/ssr-test-project/node_modules/astro/dist/runtime/server/render/any.js:36:5)
Node.js v20.9.0
Some time i get the error as following node:internal/process/promises:289 triggerUncaughtException(err, true /* fromPromise */);
The text was updated successfully, but these errors were encountered:
How can i efficiently handle cases where an image is not found or does not exist. Right now if an image is not found it basically crashes the server and throws an error.
The below code works fine if an image has been received by the component, else it throws an error.
Some time i get the error as following
node:internal/process/promises:289 triggerUncaughtException(err, true /* fromPromise */);
The text was updated successfully, but these errors were encountered: