Transaction rejection error handling

Hi I am working with Moralis using the 1inch plugin. I am having a hard time understanding where to catch a transaction rejection error. IE when I reject the transaction I would like to give a message of sorts, right now it just breaks. Thanks.

async function trySwap() {
      let address = Moralis.User.current().get("ethAddress");
      let amount = Number(fromAmount) * 10**fromTokenDecimals;
      if (tokenSymbol !== "ETH") {
        const allowance = await Moralis.Plugins.oneInch.hasAllowance({
          chain: "eth", // The blockchain you want to use (eth/bsc/polygon)
          fromTokenAddress: tokenAddress, // The token you want to swap
          fromAddress: address, // Your wallet address
          amount: amount,
        });
        if (!allowance) {
          await Moralis.Plugins.oneInch.approve({
            chain: "eth", // The blockchain you want to use (eth/bsc/polygon)
            tokenAddress: tokenAddress, // The token you want to swap
            fromAddress: address, // Your wallet address
          });
        }
      }
      try {
        await doSwap(address, amount);
        alert("Swap Complete");
      } catch (error) {
        console.log(error)
        alert('Insufficient ETH')
      }
    }
    
    function doSwap(userAddress, amount) {
      return Moralis.Plugins.oneInch.swap({
        chain: "eth", // The blockchain you want to use (eth/bsc/polygon)
        fromTokenAddress: tokenAddress, // The token you want to swap
        toTokenAddress: totokenAddress, // The token you want to receive
        amount: amount,
        fromAddress: userAddress, // Your wallet address
        slippage: 1,
      })
    }

and this is the error from rejecting the transaction through metamask

MetaMask - RPC Error: MetaMask Tx Signature: User denied transaction signature. 
Object { code: 4001, message: "MetaMask Tx Signature: User denied transaction signature." }
inpage.js:1:51499
Uncaught (in promise) 
Object { code: 4001, message: "MetaMask Tx Signature: User denied transaction signature.", stack:

It may be related to this line, if you try to not use await there and use events what happens?