← All learning notes

Debugging and testing

Distinguish an empty result from a request failure

By SI100x · Published

An empty response can be a correct result, while a failed request means the result is unknown. Mixing the two makes the interface misleading and can cause people to repeat actions unnecessarily.

Try this exercise

  1. Create a local list exercise with three outcomes: populated results, an empty collection and a controlled request error. Give each outcome its own visible explanation.
  2. Retry after the error and make the request succeed. Verify that the old failure message disappears and the actual result is displayed.
  3. If earlier results are retained during refresh, label the refresh state clearly. Do not silently present stale information as newly retrieved data.

Check your result

A user should understand whether there are no records or whether records could not be checked. The recovery action should repeat the request safely without creating duplicate records.

Explore your next step

Compare course curricula or try a free live demo to ask about prerequisites and practice work.

Explore courses →Find a free live demo →