| @@ 194-212 (lines=19) @@ | ||
| 191 | * |
|
| 192 | * @return string |
|
| 193 | */ |
|
| 194 | protected function renderXmlErrorMessage(\Exception $exception) |
|
| 195 | { |
|
| 196 | $xml = "<error>\n <message>Slim Application Error</message>\n"; |
|
| 197 | if ($this->displayErrorDetails) { |
|
| 198 | do { |
|
| 199 | $xml .= " <exception>\n"; |
|
| 200 | $xml .= " <type>" . get_class($exception) . "</type>\n"; |
|
| 201 | $xml .= " <code>" . $exception->getCode() . "</code>\n"; |
|
| 202 | $xml .= " <message>" . $this->createCdataSection($exception->getMessage()) . "</message>\n"; |
|
| 203 | $xml .= " <file>" . $exception->getFile() . "</file>\n"; |
|
| 204 | $xml .= " <line>" . $exception->getLine() . "</line>\n"; |
|
| 205 | $xml .= " <trace>" . $this->createCdataSection($exception->getTraceAsString()) . "</trace>\n"; |
|
| 206 | $xml .= " </exception>\n"; |
|
| 207 | } while ($exception = $exception->getPrevious()); |
|
| 208 | } |
|
| 209 | $xml .= "</error>"; |
|
| 210 | ||
| 211 | return $xml; |
|
| 212 | } |
|
| 213 | ||
| 214 | /** |
|
| 215 | * Returns a CDATA section with the given content. |
|
| @@ 175-193 (lines=19) @@ | ||
| 172 | * |
|
| 173 | * @return string |
|
| 174 | */ |
|
| 175 | protected function renderXmlErrorMessage(\Throwable $error) |
|
| 176 | { |
|
| 177 | $xml = "<error>\n <message>Slim Application Error</message>\n"; |
|
| 178 | if ($this->displayErrorDetails) { |
|
| 179 | do { |
|
| 180 | $xml .= " <error>\n"; |
|
| 181 | $xml .= " <type>" . get_class($error) . "</type>\n"; |
|
| 182 | $xml .= " <code>" . $error->getCode() . "</code>\n"; |
|
| 183 | $xml .= " <message>" . $this->createCdataSection($error->getMessage()) . "</message>\n"; |
|
| 184 | $xml .= " <file>" . $error->getFile() . "</file>\n"; |
|
| 185 | $xml .= " <line>" . $error->getLine() . "</line>\n"; |
|
| 186 | $xml .= " <trace>" . $this->createCdataSection($error->getTraceAsString()) . "</trace>\n"; |
|
| 187 | $xml .= " </error>\n"; |
|
| 188 | } while ($error = $error->getPrevious()); |
|
| 189 | } |
|
| 190 | $xml .= "</error>"; |
|
| 191 | ||
| 192 | return $xml; |
|
| 193 | } |
|
| 194 | ||
| 195 | /** |
|
| 196 | * Returns a CDATA section with the given content. |
|