Slaus Posted January 14, 2020 Share Posted January 14, 2020 Hello. My game loads many resources (100+); on specific PC occasional weird error happens: net::ERR_CONNECTION_RESET 200 OK for several files so loading abrupts. I failed to google what that error even means and every time it happens to different files and in 1 in 20 times game loads successfully. Errors I dealt with previously was 404 (Not Found) which was caused both by absent network or absent files, so I was just reloading the whole page hoping for network connection to recover. Anyway, error is an error, so failed files need to be recovered somehow, but I don't know how to do it yet. How can I know what files failed to load? Quote PIXI.loader.onError.add( w => console.log( w ) ) Prints: Error: Failed to load element using: IMG Is there a way to know which file failed to load? How can I add failed file back to the loading bundle continuing the ongoing loading process? If sub-resource failed to load (for example, .png file of .json spritesheet) should I re-queue that sub-resource or it's parent? Thanks in advance. ivan.popelyshev 1 Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted January 16, 2020 Share Posted January 16, 2020 (edited) I had that problem in production. What i did - I reset() the loader and added everything again. On any error. But I guess its not for your case: > it happens to different files and in 1 in 20 times game loads successfully. So far I didn't see code that does reloading of individual resources in case of error in public (forum, issues). Please share it if you make something. It shouldn't be that difficult, if you read sources of resource-loader ( https://github.com/englercj/resource-loader/ ) Edited January 16, 2020 by ivan.popelyshev Slaus 1 Quote Link to comment Share on other sites More sharing options...
Slaus Posted January 17, 2020 Author Share Posted January 17, 2020 Thank for your answer, Ivan. I've got an answer from Engler about OnError being called with the error, the loader, and the resource that failed. http://englercj.github.io/resource-loader/classes/loader.html#onerrorsignal Got too used to error handlers being called with single error objects, so didn't look for docs, sorry my bad. Since I didn't know how to catch what files failed to load, so I just reset the loader and reload all the resources again relying on browser cache to handle repeats and it magically worked well. Thanks for your help. ivan.popelyshev 1 Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted January 17, 2020 Share Posted January 17, 2020 Well, now you share my pain, I'm happy Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.