public function getFormattedError(array $error, $header = '')
    {
        $output = "<table style='background:#fcf8e3;
                                 color:#8a6d3b;
                                 width:100%;
                                 margin-bottom:10px;
                                 border: 1px solid #faebcc;
                                 border-collapse: collapse;'>";

        if (!empty($header)) {
            $output .= "<tr>
                          <td colspan='2' style='border-bottom: 1px solid #faebcc;'><b>$header</b></td>
                        </tr>\n";
        }

        $output .= "<tr>
                      <td style='background-color: #faebcc;'>Message </td>
                      <td style='border-bottom: 1px solid #faebcc;'>{$error['message']}</td>
                    </tr>\n";

        if (isset($error['code'])) {
            $output .= "<tr>
                          <td style='background-color: #faebcc;'>Code </td>
                          <td style='border-bottom: 1px solid #faebcc;'>{$error['code']}</td>
                       </tr>\n";
        }

        if (isset($error['type'])) {
            $output .= "<tr>
                          <td style='background-color: #faebcc;'>Type </td>
                          <td style='border-bottom: 1px solid #faebcc;'>{$error['type']}</td>
                        </tr>\n";
        }

        $output .= "<tr>
                      <td style='background-color: #faebcc;'>File </td>
                      <td style='border-bottom: 1px solid #faebcc;'>{$error['file']}</td>
                    </tr>
                    <tr>
                      <td style='background-color: #faebcc;'>Line </td>
                      <td style='border-bottom: 1px solid #faebcc;'>{$error['line']}</td>
                    </tr>\n";

        if ($this->print_backtrace && !empty($error['backtrace'])) {
            $error['backtrace'] = implode("<br>\n", $error['backtrace']);
            $output .= "<tr>
                          <td style='background-color: #faebcc;'>Backtrace </td>
                          <td style='border-bottom: 1px solid #faebcc;'>{$error['backtrace']}</td>
                        </tr>\n";
        }

        $output .= '</table>';
        return GC_CLI ? preg_replace("/(\n| )+/", "$1", trim(strip_tags($output))) : $output;
    }
public function getFormattedError(array $error, $header = '')
    {
        $output = "<table style='background:#fcf8e3;
                                 color:#8a6d3b;
                                 width:100%;
                                 margin-bottom:10px;
                                 border: 1px solid #faebcc;
                                 border-collapse: collapse;'>";

        if (!empty($header)) {
            $output .= "<tr>
                          <td colspan='2' style='border-bottom: 1px solid #faebcc;'><b>$header</b></td>
                        </tr>\n";
        }

        $output .= "<tr>
                      <td style='background-color: #faebcc;'>Message </td>
                      <td style='border-bottom: 1px solid #faebcc;'>{$error['message']}</td>
                    </tr>\n";

        if (isset($error['code'])) {
            $output .= "<tr>
                          <td style='background-color: #faebcc;'>Code </td>
                          <td style='border-bottom: 1px solid #faebcc;'>{$error['code']}</td>
                       </tr>\n";
        }

        if (isset($error['type'])) {
            $output .= "<tr>
                          <td style='background-color: #faebcc;'>Type </td>
                          <td style='border-bottom: 1px solid #faebcc;'>{$error['type']}</td>
                        </tr>\n";
        }

        $output .= "<tr>
                      <td style='background-color: #faebcc;'>File </td>
                      <td style='border-bottom: 1px solid #faebcc;'>{$error['file']}</td>
                    </tr>
                    <tr>
                      <td style='background-color: #faebcc;'>Line </td>
                      <td style='border-bottom: 1px solid #faebcc;'>{$error['line']}</td>
                    </tr>\n";

        if ($this->print_backtrace && !empty($error['backtrace'])) {
            $error['backtrace'] = implode("<br>\n", $error['backtrace']);
            $output .= "<tr>
                          <td style='background-color: #faebcc;'>Backtrace </td>
                          <td style='border-bottom: 1px solid #faebcc;'>{$error['backtrace']}</td>
                        </tr>\n";
        }

        $output .= '</table>';
        return GC_CLI ? preg_replace("/(\n| )+/", "$1", trim(strip_tags($output))) : $output;
    }
public function getFormattedError ( array $ error , $ header = '' ) { $ output = "<table style='background:#fcf8e3;
                                 color:#8a6d3b;
                                 width:100%;
                                 margin-bottom:10px;
                                 border: 1px solid #faebcc;
                                 border-collapse: collapse;'>" ; if ( ! empty ( $ header ) ) { $ output .= "<tr>
                          <td colspan='2' style='border-bottom: 1px solid #faebcc;'><b>$header</b></td>
                        </tr>\n" ; } $ output .= "<tr>
                      <td style='background-color: #faebcc;'>Message </td>
                      <td style='border-bottom: 1px solid #faebcc;'>{$error['message']}</td>
                    </tr>\n" ; if ( isset ( $ error [ 'code' ] ) ) { $ output .= "<tr>
                          <td style='background-color: #faebcc;'>Code </td>
                          <td style='border-bottom: 1px solid #faebcc;'>{$error['code']}</td>
                       </tr>\n" ; } if ( isset ( $ error [ 'type' ] ) ) { $ output .= "<tr>
                          <td style='background-color: #faebcc;'>Type </td>
                          <td style='border-bottom: 1px solid #faebcc;'>{$error['type']}</td>
                        </tr>\n" ; } $ output .= "<tr>
                      <td style='background-color: #faebcc;'>File </td>
                      <td style='border-bottom: 1px solid #faebcc;'>{$error['file']}</td>
                    </tr>
                    <tr>
                      <td style='background-color: #faebcc;'>Line </td>
                      <td style='border-bottom: 1px solid #faebcc;'>{$error['line']}</td>
                    </tr>\n" ; if ( $ this -> print_backtrace && ! empty ( $ error [ 'backtrace' ] ) ) { $ error [ 'backtrace' ] = implode ( "<br>\n" , $ error [ 'backtrace' ] ) ; $ output .= "<tr>
                          <td style='background-color: #faebcc;'>Backtrace </td>
                          <td style='border-bottom: 1px solid #faebcc;'>{$error['backtrace']}</td>
                        </tr>\n" ; } $ output .= '</table>' ; return GC_CLI ? preg_replace ( "/(\n| )+/" , "$1" , trim ( strip_tags ( $ output ) ) ) : $ output ; }
Formats an error message
@param array $error
@param string $header
@return string
Formats an error message