ragnarlotus/vue-flux

Gracefully skip invalid image urls without crashing

Closed this issue · 6 comments

Hey,

Right now the slider component crashes when the images array contains one or more invalid image urls. Because i'm using an external API, i can't be sure if the given urls are valid. Is there a way to circumvent this?

Thanks

Hello, currently it is supposed to do so, when image can't be loaded should displaying a warning in the console.

Otherwise, please provide a repo or something I can try and test against.

Regards!

Hi,

Thanks for the reply. The thing is, a warning is not the problem. The whole component crashes and doesn't work anymore. With invalid urls i mean images that can't be loaded (because the url doesn't exists anymore). Of course i could filter the urls before passing them to the slider component. I was just wondering if there was build in support for this.

Thanks anyways!

I was just wondering if there was build in support for this

Indeed, it should. Maybe there is a kind of problem that I missed it in the last stages of development, but the image loading is supposed to be controlled and error safe:

img.load().then(() => {
   this.loadSuccess(img);
}).catch(error => {
   this.loadError(error);
});

I will check it and let you now :)

Regards!

Hello, I just checked the soft fail and was working fine, but the counting of images had a missing sum.

I am fixing it and trying to match the captions. I think this will solve your problem. Can you let me know if you had an error in your console or was just the warning?

I will release a new version soon 😀

Regards!

Hello, I released 6.0.3 which should fix images error controller.

Do you mind trying it out?

Thank you and regards!

Version 6.0.3 has been published.

Let me know if you find any problem.

Regards