Fix the function printUserCount.
It should call handleUnknownError if the Promise is rejected.

This task is part of the Full-Stack JavaScript Course
If you have any issues with it, you can ask for community help below the post
Feel free to help others if you’ve already solved the task

db.js

const db = {
  users: [
    {
      id: 1,
      name: 'Jack',
      friends: [ 23, 125 ],
    }, {
      id: 23,
      name: 'Jane',
      friends: [ 125 ],
    }, {
      id: 125,
      name: 'Jill',
      friends: [ 1 ],
    }
  ]
}

export const getUserCount = () => new Promise((resolve, reject) => {
  const isError = Math.random() > 0.5;
  if (isError) {
    reject(new Error('An unknown error occurred!'));
  }
  setTimeout(() => resolve(db.users.length), 200);
});

errorHandlers.js

export const handleUnknownError = (e) => {
  console.log(e.message);
}

functions.js

import { getUserCount } from './db.js';
import { handleUnknownError } from './errorHandlers.js';

export const printUserCount = () => {
  try {
    return getUserCount().then(console.log);
  } catch (e) {
    handleUnknownError(e);
  }
}

solution.js

import { printUserCount } from './functions.js';

printUserCount();