Throwing an error is unnecessary when we can return a rejected Promise. We add a test as well to check this.
Run:
npx vitest