Repo for the search and displace ingest module that takes odf, docx and pdf and transforms it into .md to be used with search and displace operations
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

71 lines
1.6 KiB

  1. <?php
  2. namespace App\Exceptions;
  3. use Exception;
  4. use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
  5. use Symfony\Component\HttpKernel\Exception\HttpException;
  6. use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
  7. class Handler extends ExceptionHandler
  8. {
  9. /**
  10. * A list of the exception types that are not reported.
  11. *
  12. * @var array
  13. */
  14. protected $dontReport = [//
  15. ];
  16. /**
  17. * A list of the inputs that are never flashed for validation exceptions.
  18. *
  19. * @var array
  20. */
  21. protected $dontFlash = [
  22. 'password',
  23. 'password_confirmation',
  24. ];
  25. /**
  26. * Report or log an exception.
  27. *
  28. * @param \Exception $exception
  29. *
  30. * @return void
  31. *
  32. * @throws \Exception
  33. */
  34. public function report(Exception $exception)
  35. {
  36. parent::report($exception);
  37. }
  38. /**
  39. * Render an exception into an HTTP response.
  40. *
  41. * @param \Illuminate\Http\Request $request
  42. * @param \Exception $exception
  43. *
  44. * @return \Symfony\Component\HttpFoundation\Response
  45. *
  46. * @throws \Exception
  47. */
  48. public function render($request, Exception $exception)
  49. {
  50. if ($this->isHttpException($exception))
  51. {
  52. $statusCode = $exception->getStatusCode();
  53. return response()->view("errors.".$statusCode, ['code'=>$statusCode], $statusCode);
  54. }
  55. if ($exception instanceof HttpException) {
  56. return response()->view('errors::404', [], 404);
  57. }
  58. return parent::render($request, $exception);
  59. }
  60. }