норм сообщением было.
                  
                  
                  Чекните код, что может пойти не так?
                  
                  
                  
                  
                  
                  
                  
                  
                  php
                  
                  
                  namespace App\Exceptions;
                  
                  
                  
                  
                  
                  class Handler extends ExceptionHandler
                  
                  
                  {
                  
                  
                  ...
                  
                  
                  public function render($request, Throwable $exception)
                  
                  
                  {
                  
                  
                      $docxException = $this->getDocxSyntaxExceptionExceptionRecursively($exception);
                  
                  
                      if ($docxException) {
                  
                  
                          return response()->view('errors.500', ['message' => $docxException->getMessage()], 500);
                  
                  
                      }
                  
                  
                  
                  
                  
                      return parent::render($request, $exception);
                  
                  
                  }
                  
                  
                  
                  
                  
                  private function getDocxSyntaxExceptionExceptionRecursively(Throwable $exception): ?Throwable
                  
                  
                  {
                  
                  
                      if (is_null($exception)) {
                  
                  
                          return null;
                  
                  
                      }
                  
                  
                  
                  
                  
                      if (is_a($exception, DocxPlaceholderSyntaxException::class)) {
                  
                  
                          return $exception;
                  
                  
                      }
                  
                  
                  
                  
                  
                      return $this->getDocxSyntaxExceptionExceptionRecursively($exception->getPrevious());
                  
                  
                  }
                  
                  
                
Ну как минимум эта проверка у тебя вообще бесполезна)
Обсуждают сегодня