From 6164991038e7a46438ca9b7932238267e2000585 Mon Sep 17 00:00:00 2001 From: jcardenascentral <41021346+jcardenascentral@users.noreply.github.com> Date: Wed, 11 Sep 2019 09:57:47 -0500 Subject: [PATCH] Get the original message of the Exception --- src/Dispatcher.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Dispatcher.php b/src/Dispatcher.php index 85218fd56..5ec946556 100644 --- a/src/Dispatcher.php +++ b/src/Dispatcher.php @@ -541,7 +541,11 @@ protected function dispatch(InternalRequest $request) $response = $this->router->dispatch($request); if (! $response->isSuccessful() && ! $response->isRedirection()) { - throw new InternalHttpException($response); + $message = null; + if (isset($response->getOriginalContent()['message'])) { + $message = $response->getOriginalContent()['message']; + } + throw new InternalHttpException($response, $message); } if (! $this->raw) {