Skip to content

Commit

Permalink
Refactored exception/error handlers.
Browse files Browse the repository at this point in the history
  • Loading branch information
bbankowski committed Dec 11, 2023
1 parent f0130a8 commit 5849923
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Ouzo/Core/ExceptionHandling/DebugExceptionHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

namespace Ouzo\ExceptionHandling;

use Ouzo\Http\MediaType;
use Ouzo\Response\ResponseTypeResolve;
use Ouzo\Uri;
use Whoops\Handler\PrettyPageHandler;
Expand All @@ -27,7 +28,7 @@ public function runDefaultHandler($exception): void

private function needPrettyHandler(): bool
{
$isHtmlResponse = ResponseTypeResolve::resolve() === 'text/html';
$isHtmlResponse = ResponseTypeResolve::resolve() === MediaType::TEXT_HTML;
return $isHtmlResponse && !Uri::isAjax();
}
}

0 comments on commit 5849923

Please sign in to comment.