Mercurial > hg > isophonics-drupal-site
comparison vendor/symfony/debug/Exception/FlattenException.php @ 12:7a779792577d
Update Drupal core to v8.4.5 (via Composer)
author | Chris Cannam |
---|---|
date | Fri, 23 Feb 2018 15:52:07 +0000 |
parents | 4c8ae668cc8c |
children | c2387f117808 |
comparison
equal
deleted
inserted
replaced
11:bfffd8d7479a | 12:7a779792577d |
---|---|
9 * file that was distributed with this source code. | 9 * file that was distributed with this source code. |
10 */ | 10 */ |
11 | 11 |
12 namespace Symfony\Component\Debug\Exception; | 12 namespace Symfony\Component\Debug\Exception; |
13 | 13 |
14 use Symfony\Component\HttpFoundation\Exception\RequestExceptionInterface; | |
14 use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface; | 15 use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface; |
15 | 16 |
16 /** | 17 /** |
17 * FlattenException wraps a PHP Exception to be able to serialize it. | 18 * FlattenException wraps a PHP Exception to be able to serialize it. |
18 * | 19 * |
39 $e->setCode($exception->getCode()); | 40 $e->setCode($exception->getCode()); |
40 | 41 |
41 if ($exception instanceof HttpExceptionInterface) { | 42 if ($exception instanceof HttpExceptionInterface) { |
42 $statusCode = $exception->getStatusCode(); | 43 $statusCode = $exception->getStatusCode(); |
43 $headers = array_merge($headers, $exception->getHeaders()); | 44 $headers = array_merge($headers, $exception->getHeaders()); |
45 } elseif ($exception instanceof RequestExceptionInterface) { | |
46 $statusCode = 400; | |
44 } | 47 } |
45 | 48 |
46 if (null === $statusCode) { | 49 if (null === $statusCode) { |
47 $statusCode = 500; | 50 $statusCode = 500; |
48 } | 51 } |