fix: error rendering

This commit is contained in:
peaklabs-dev
2025-01-06 17:49:55 +01:00
parent 503d2b4866
commit a29547b3ba
2 changed files with 13 additions and 13 deletions

View File

@@ -21,10 +21,10 @@ function generateGithubToken(GithubApp $source, string $type)
if ($timeDiff > 0) { if ($timeDiff > 0) {
throw new \Exception( throw new \Exception(
'System time is out of sync with GitHub API time:'.PHP_EOL. 'System time is out of sync with GitHub API time:<br>'.
'- System time: '.$serverTime->format('Y-m-d H:i:s').' UTC'.PHP_EOL. '- System time: '.$serverTime->format('Y-m-d H:i:s').' UTC<br>'.
'- GitHub time: '.$githubTime->format('Y-m-d H:i:s').' UTC'.PHP_EOL. '- GitHub time: '.$githubTime->format('Y-m-d H:i:s').' UTC<br>'.
'- Difference: '.$timeDiff.' seconds'.PHP_EOL. '- Difference: '.$timeDiff.' seconds<br>'.
'Please synchronize your system clock.' 'Please synchronize your system clock.'
); );
} }
@@ -96,11 +96,11 @@ function githubApi(GithubApp|GitlabApp|null $source, string $endpoint, string $m
$remainingCalls = $response->header('X-RateLimit-Remaining', '0'); $remainingCalls = $response->header('X-RateLimit-Remaining', '0');
throw new \Exception( throw new \Exception(
"GitHub API call failed:\n". 'GitHub API call failed:<br>'.
"Error: {$errorMessage}\n". "Error: {$errorMessage}<br>".
"Rate Limit Status:\n". 'Rate Limit Status:<br>'.
"- Remaining Calls: {$remainingCalls}\n". "- Remaining Calls: {$remainingCalls}<br>".
"- Reset Time: {$resetTime} UTC" "- Reset Time: {$resetTime} UTC"
); );
} }

View File

@@ -3,11 +3,11 @@
<div> <div>
<p class="font-mono font-semibold text-red-500 text-7xl">500</p> <p class="font-mono font-semibold text-red-500 text-7xl">500</p>
<h1 class="mt-4 font-bold tracking-tight dark:text-white">Wait, this is not cool...</h1> <h1 class="mt-4 font-bold tracking-tight dark:text-white">Wait, this is not cool...</h1>
<p class="text-base leading-7 text-neutral-300">There has been an error, we are working on it. <p class="text-base leading-7 text-neutral-300">There has been an error, we are working on it.</p>
</p>
@if ($exception->getMessage() !== '') @if ($exception->getMessage() !== '')
<code class="mt-6 text-xs text-left text-red-500">Error: {{ $exception->getMessage() }} <div class="mt-6 text-xs text-left text-red-500 whitespace-pre-wrap">
</code> Error: {!! nl2br(e($exception->getMessage())) !!}
</div>
@endif @endif
<div class="flex items-center mt-10 gap-x-6"> <div class="flex items-center mt-10 gap-x-6">
<a href="/"> <a href="/">