Apologies. Here is the code:
#!/bin/bash

PASSWORD=$(zenity --password --title="Enter Password")

if [ $? -ne 0 ]; then
  zenity --error --text="Password entry cancelled."
  exit 1
fi

echo $PASSWORD | zfs load-key rpool/encrypted
if [ $? -ne 0 ]; then
  zenity --error --text="Error loading key. Check password and try again."
  exit 1
fi

zfs mount rpool/encrypted
if [ $? -ne 0 ]; then
  zenity --error --text="Error mounting encrypted dataset."
  exit 1
fi

zenity --info --text="Encrypted dataset rpool/encrypted successfully mounted."
spam fails_task lang_mismatch pii not_appropriate hate_speech sexual_content quality toxicity humor helpfulness creativity violence