Open Ajayneethikannan opened 5 years ago
Would be great if possible. I think the current challenge is to identify that a loading function call has failed and retaining capability for the user to handle the error themselves.
I am pro this in general, and agree with @limzykenneth that implementation is a bit problematic at the moment.
If/when we move to all-promise based preloads (#2698) this becomes much more plausible to implement, and would, indeed, be quite simple.
I could see a simple API being something like the following, with a default implementation of preloadFailed
for when it is not manually specified:
function preload() {
loadStrings('404.txt');
}
function preloadFailed() {
// Allow the user to draw here maybe?
}
function draw() {
// use the data from the loadStrings call
}
@meiamsome I kind of had a feeling it's implementation would become easier with promises, Thank you for the clarifications @limzykenneth , @meiamsome ! Would like to wait on it then :+1:
@limzykenneth ,can i work on this issue?
@limzykenneth can u guide me where to look for solving this issue
@singhvisha Are you still looking into this issue?
Hi @devashish1099, @singhvisha did asked to work on this first so I'll leave a few days for him to reply if he's still working on this issue. However, from the discussions above, there isn't a straightforward solution to this issue. If you want to have a crack at it anyway you can familiarize yourself with how preload and the loading functions work first, then if you come up with a solution, you can propose it here for us to discuss it.
Nature of issue?
appropriate sub-area of p5.js?
Which platform were you using when you encountered this?
Details about the bug:
https://editor.p5js.org/TheSkepticSniper/sketches/Hpintvgpy - This sketch can be used for reference
Feature enhancement details:
Currently , if any load method fails in preload function, the sketch does not proceed to setup and draw due to preload's blocking nature, but the text when preload is executing remains saying 'loading...' It would be nice to improve the feature , by making the text box say 'some error has occurred' when any method fails in the preload function.
Would love to hear suggestions on this, Thanks!