loadSound does not reject on 404 response

Open Beginner friendly
#127 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
65/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
javascript

Research direction

Find the loadSound implementation and its audio loading path, then check how a 404 is reported and how the returned Promise handles failures. Make the Promise reject when the audio file cannot be loaded, and confirm the failure can be caught by conventional error handling.

Written by the indexing model from the issue text.

Description

As the title states.

Latest release (p5.sound.js 0.4.1)

loadSound returns a Promise, which is fulfilled with a SoundFile if everything goes correctly.
However, if something goes wrong (i.e. the audio file does not exist at the specified path), the promise is never rejected - instead, it remains pending.

This prevents any conventional means of error handling.

Dominant language
JavaScript
Stars
60
Forks
28
Avg merge
8h 53m
Merged PRs (30d)
2

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from processing/p5.sound.js

All issues in processing/p5.sound.js

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.