Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/Phaseolies/Error/WebErrorRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
use Phaseolies\Http\Controllers\Controller;
use Throwable;

use function Tests\Unit\Application\config;

class WebErrorRenderer
{
/**
Expand Down Expand Up @@ -47,8 +49,6 @@ public function renderDebug(Throwable $exception): string
'email' => $user->email ?? 'N/A',
] : null;

date_default_timezone_set(config('app.timezone'));

$mdReport = new ExceptionMarkdownReport($exception);

// setup the controller to point out to different views location
Expand All @@ -68,6 +68,7 @@ public function renderDebug(Throwable $exception): string
'php_version' => PHP_VERSION,
'doppar_version' => Application::VERSION,
'request_method' => request()->getMethod(),
'request_body' => request()->all(),
'request_url' => trim(request()->fullUrl(), '/'),
'timestamp' => now()->toDayDateTimeString(),
'server_software' => $_SERVER['SERVER_SOFTWARE'] ?? 'Unknown',
Expand All @@ -79,6 +80,10 @@ public function renderDebug(Throwable $exception): string
'exception_class' => class_basename($exception),
'status_code' => $exception->getCode() ?: 500,
'md_content' => $mdReport->generate(),
'current_middleware' => \Phaseolies\Support\Facades\Route::getCurrentMiddlewareNames(),
'current_route_name' => \Phaseolies\Support\Facades\Route::currentRouteName(),
'current_route_action' => \Phaseolies\Support\Facades\Route::currentRouteAction(),
'current_route_params' => request()->getRouteParams()
]);
}

Expand Down
63 changes: 25 additions & 38 deletions src/Phaseolies/Error/views/template-headers.odo.php
Original file line number Diff line number Diff line change
@@ -1,38 +1,25 @@
<div
id="single-accordion-container"
data-open-by-default
class=" dark:bg-neutral-900 bg-neutral-900/[1%] overflow-hidden rounded-lg">
<div
class="border border-neutral-200 dark:border-neutral-800 rounded-lg overflow-hidden transition-all duration-200 border-dashed">
<!-- header area -->
<div
class="accordion-header flex items-center gap-3 p-3 bg-neutral-50 dark:bg-neutral-900 cursor-pointer"
tabindex="0"
role="button"
aria-expanded="false"
aria-controls="accordion-content">
<div class="flex-1 min-w-0">
<div class="font-mono text-lg font-bold truncate">Headers</div>
<div class="text-xs text-neutral-500 font-mono truncate">HTTP Request Headers</div>
</div>
<svg class="accordion-arrow w-5 h-5 text-neutral-400 transition-transform duration-200 shrink-0"
fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path>
</svg>
</div>
<!-- contaainer area -->
<div class="accordion-content bg-white dark:bg-neutral-950/30 border-t border-dashed border-neutral-200 dark:border-neutral-800 hidden"
role="region" aria-labelledby="accordion-header">
<div class="p-3 font-mono">
#foreach ($headers as $header_name => $header)
<div class="header flex gap-4 dark:text-neutral-400 text-neutral-700 items-center">
<span class="uppercase">[[ $header_name ]]:</span>
<div class="flex-1 dark:border-white/10 border-neutral-900/10 border border-dashed h-[1px]">
</div>
<span class="ml-auto">[[ $header ]]</span>
</div>
#endforeach
</div>
</div>
</div>
</div>
<div class="headers-toggle border-b border-black/5 dark:border-white/5 bg-black/2 dark:bg-white/2" data-headers-toggle tabindex="0" role="button" aria-expanded="false">
<div class="w-7 h-7 rounded-lg bg-sky-50 dark:bg-sky-500/10 border border-sky-100 dark:border-sky-500/20 flex items-center justify-center shrink-0">
<svg class="w-3.5 h-3.5 text-sky-500" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 10h16M4 14h16M4 18h16" />
</svg>
</div>
<div class="flex-1">
<div class="text-sm font-semibold">Headers</div>
<div class="text-[11px] text-slate-400 dark:text-slate-600 mt-0.5">HTTP Request Headers</div>
</div>
<svg class="arrow-icon w-4 h-4 text-slate-400 shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7" />
</svg>
</div>
<div class="headers-panel bg-white/40 dark:bg-black/10" data-headers-panel>
<div class="px-5 py-4 font-mono text-xs space-y-1">
#foreach ($headers as $header_name => $header_value)
<div class="flex items-center gap-3 py-1.5 border-b border-black/3 dark:border-white/3 last:border-0">
<span class="uppercase text-slate-500 shrink-0 w-44 truncate">[[ $header_name ]]</span>
<div class="flex-1 border-t border-dashed border-black/10 dark:border-white/10 h-px"></div>
<span class="text-slate-700 dark:text-slate-300 text-right truncate max-w-xs">[[ $header_value ]]</span>
</div>
#endforeach
</div>
</div>
Loading
Loading