Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ocasional panic #4

Closed
gilescope opened this issue Sep 20, 2022 · 3 comments · Fixed by #5
Closed

ocasional panic #4

gilescope opened this issue Sep 20, 2022 · 3 comments · Fixed by #5
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@gilescope
Copy link

The unwrap here is causing a panic occasionally:

let resp_value = JsFuture::from(window.fetch_with_str(uri)).await.unwrap();

panicked at 'called `Result::unwrap()` on an `Err` value: JsValue(TypeError: NetworkError when attempting to fetch resource.
)', /home/gilescope/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_web_asset-0.4.0/src/web_asset_io.rs:26:83
@johanhelsing
Copy link
Owner

Thanks. I guess warning and retrying after a small timeout is probably the best thing to do in most cases?

We could do that as first measure, then add special casing for various http 4xx and 5xx codes later.

@johanhelsing johanhelsing added bug Something isn't working good first issue Good for newcomers labels Sep 20, 2022
@gilescope
Copy link
Author

gilescope commented Sep 20, 2022 via email

johanhelsing added a commit that referenced this issue Sep 23, 2022
Instead warn before reporting the asset as NotFound, same as we do on
native.

Ideally, we'd handle the actual errors, but this makes the two
implementation behave similarly at least.

Fixes: #4
@johanhelsing
Copy link
Owner

I fixed the panic at least. Don't have time to look into retrying now, but created new issues for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants