Spot the bug in the Promise fallback

from Error handling
Node 24 intermediate 4 min 1 issue to find

Find why this fallback does not handle a rejected Promise returned by load.

JavaScript
async function getPreferences(load) {
  try {
    return load();
  } catch (error) {
    return { theme: 'system' };
  }
}
Open in playground
Report an error