renderExceptionSafe example

->keys(['sid' => Crypt::hashBase64($sid)])
        ->fields($fields)
        ->execute();
      return TRUE;
    }
    catch (\Exception $exception) {
      require_once DRUPAL_ROOT . '/core/includes/errors.inc';
      // If we are displaying errors, then do so with no possibility of a       // further uncaught exception being thrown.       if (error_displayable()) {
        print '<h1>Uncaught exception thrown in session handler.</h1>';
        print '<p>' . Error::renderExceptionSafe($exception) . '</p><hr />';
      }
      return FALSE;
    }
  }

  /** * {@inheritdoc} */
  #[\ReturnTypeWillChange]   public function close() {
    return TRUE;
  }
Home | Imprint | This part of the site doesn't use cookies.