Rejecting an error using the async function