Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Exception.php

function PEAR_Exception::toText

Generates text representation of the exception and stack trace

Return value

string

1 call to PEAR_Exception::toText()
PEAR_Exception::__toString in vendor/pear/pear_exception/PEAR/Exception.php
Converts the exception to a string (HTML or plain text)

File

vendor/pear/pear_exception/PEAR/Exception.php, line 443

Class

PEAR_Exception
Base PEAR_Exception Class

Code

public function toText() {
    $causes = array();
    $this->getCauseMessage($causes);
    $causeMsg = '';
    foreach ($causes as $i => $cause) {
        $causeMsg .= str_repeat(' ', $i) . $cause['class'] . ': ' . $cause['message'] . ' in ' . $cause['file'] . ' on line ' . $cause['line'] . "\n";
    }
    return $causeMsg . $this->getTraceAsString();
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal