Example #1
0
File: CLI.php Project: poef/ariadne
 /**
  * Renders an exception
  *
  * @param Exception $e
  */
 protected function renderException(Exception $e)
 {
     $hasColors = $this->detectColors();
     // excerpt?
     if ($e instanceof ILess_Exception) {
         printf("%s: %s\n", $this->scriptName, $hasColors && !$this->getOption('no_color') ? ILess_ANSIColor::colorize($e->toString(false), 'red') : $e->toString(false));
         if ($excerpt = $e->getExcerpt()) {
             $hasColors ? printf("%s\n", $excerpt->toTerminal()) : printf("%s\n", $excerpt->toText());
         }
     } else {
         printf("%s: %s\n", $this->scriptName, $hasColors && !$this->getOption('no_color') ? ILess_ANSIColor::colorize($e->getMessage(), 'red') : $e->getMessage());
     }
 }