error_displayable example

/** * Wrapper for error_displayable(). * * @param $error * Optional error to examine for ERROR_REPORTING_DISPLAY_SOME. * * @return bool * * @see \error_displayable */
  protected function isErrorDisplayable($error) {
    return error_displayable($error);
  }

  /** * Attempts to reduce error verbosity in the error message's file path. * * Attempts to reduce verbosity by removing DRUPAL_ROOT from the file path in * the message. This does not happen for (false) security. * * @param $error * Optional error to examine for ERROR_REPORTING_DISPLAY_SOME. * * @return array * The updated $error. */

      $this->connection->merge('sessions')
        ->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]
Home | Imprint | This part of the site doesn't use cookies.