File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -173,9 +173,13 @@ protected function getExceptionMessage($exception)
173173 $ exceptionMap = $ this ->container ->getParameter ('fos_rest.exception.messages ' );
174174 $ showExceptionMessage = $ this ->isSubclassOf ($ exception , $ exceptionMap );
175175
176- return $ showExceptionMessage || $ this ->container ->get ('kernel ' )->isDebug ()
177- ? $ exception ->getMessage ()
178- : Response::$ statusTexts [$ this ->getStatusCode ($ exception )];
176+ if ($ showExceptionMessage || $ this ->container ->get ('kernel ' )->isDebug ()) {
177+ return $ exception ->getMessage ();
178+ }
179+
180+ $ statusCode = $ this ->getStatusCode ($ exception );
181+
182+ return array_key_exists ($ statusCode , Response::$ statusTexts ) ? Response::$ statusTexts [$ statusCode ] : 'error ' ;
179183 }
180184
181185 /**
You can’t perform that action at this time.
0 commit comments