function buildErrorCard() {
  let cardHeader = CardService.newCardHeader()
    .setTitle('Uh oh! Something went wrong.')

  let errorMessage = CardService.newTextParagraph()
    .setText(
      'It looks like Gemini got stage fright.');

  let tryAgainButton = CardService.newTextButton()
    .setText('Try again')
    .setTextButtonStyle(CardService.TextButtonStyle.TEXT)
    .setOnClickAction( CardService.newAction()
    .setFunctionName('onLinkPreview'));

  let buttonList = CardService.newButtonSet()
    .addButton(tryAgainButton);

  let mainSection = CardService.newCardSection()
    .addWidget(errorMessage)
    .addWidget(buttonList);

  let errorCard = CardService.newCardBuilder()
    .setHeader(cardHeader)
    .addSection(mainSection)
    .build();

  return errorCard;
}
Creates a Card to let user know an error has occurred.

@return {!Card}