This commit is contained in:
Mateusz Gruszczyński committed 2026-10-09 10:53:10 +02:00
1 parent ad620c976a
commit 0973129c17
26 files changed
+2255 -2245

No files matched your search

+13 -88
View File
@@ -1,88 +1,13 @@
<!DOCTYPE html>
<html lang="en" data-theme="dark">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Error {{ error.code or 500 }}</title>
<meta name="theme-color" content="#0f1115" />
<link rel="preload" href="{{ url_for('static', filename='css/main.css') }}" as="style">
<link rel="stylesheet" href="{{ url_for('static', filename='css/main.css') }}">
</head>
<body>
<header class="site-header">
<div class="brand">
<svg aria-hidden="true" width="24" height="24" viewBox="0 0 24 24">
<path d="M4 4h16v4H4zM4 10h10v4H4zM4 16h16v4H4z" fill="currentColor" />
</svg>
<span>Hosts Converter</span>
</div>
<nav class="actions">
<button class="btn ghost" type="button" data-action="toggle-theme" aria-label="Toggle theme">🌓</button>
<a class="btn primary" href="/" rel="nofollow">Home</a>
</nav>
</header>
<main class="container">
<section class="card error-card">
<div class="error-hero">
<div class="error-illustration" aria-hidden="true">⚠️</div>
<div class="error-main">
<div class="status-badge">Error {{ error.code or 500 }}</div>
<h1 class="error-title">
{% if (error.code or 500) == 400 %}Bad request
{% elif (error.code or 500) == 403 %}Forbidden
{% elif (error.code or 500) == 404 %}Not found
{% elif (error.code or 500) == 413 %}Payload too large
{% elif (error.code or 500) == 415 %}Nieobs&#322;ugiwany format listy
{% elif (error.code or 500) == 422 %}Nie mo&#380;na przetworzy&#263; listy
{% elif (error.code or 500) == 502 %}Nie uda&#322;o si&#281; pobra&#263; listy
{% elif (error.code or 500) == 500 %}Internal server error
{% else %}Something went wrong
{% endif %}
</h1>
<p class="muted">{{ (error.description|string)|e }}</p>
<div class="error-actions">
<button class="btn" type="button" data-action="try-again">Try again</button>
<a class="btn outline" href="/" rel="nofollow">Go home</a>
</div>
</div>
</div>
<details class="error-details">
<summary>
<span class="summary-title">Error details</span>
<span class="summary-hint">click to expand</span>
</summary>
<div class="details-body">
<pre id="error-dump" class="mono">
code: {{ error.code or 500 }}
message: {{ (error.description|string) }}
path: {{ request.path if request else '/' }}
method: {{ request.method if request else 'GET' }}
user_ip: {{ request.remote_addr if request else '' }}
user_agent: {{ request.headers.get('User-Agent') if request else '' }}
</pre>
<div class="details-actions">
</div>
</div>
</details>
</section>
</main>
<footer class="site-footer">
<div>&copy; 2025 <a href="https://www.linuxiarz.pl" target="_blank" rel="noopener">linuxiarz.pl</a></div>
<div class="meta">Your IP: <strong>{{ request.remote_addr if request else '' }}</strong></div>
</footer>
<div id="toast" role="status" aria-live="polite" aria-atomic="true"></div>
<script defer src="{{ url_for('static', filename='js/main.js') }}"></script>
<script defer src="{{ url_for('static', filename='js/error.js') }}"></script>
</body>
</html>
{% extends 'base.html' %}
{% set page = 'error' %}
{% block title %}Error {{ code }}{% endblock %}
{% block content %}
<section class="page-intro"><div><div class="eyebrow error-eyebrow">REQUEST / ERROR {{ code }}</div><h1>We couldn't <em>complete that.</em></h1><p class="lead">Your request could not be processed. Review the details below and try a different source if needed.</p></div></section>
<section class="card error-card">
<div class="error-head"><div class="error-icon" aria-hidden="true">!</div><div><span class="small-label">HTTP {{ code }} / REQUEST FAILED</span><h2>{% if code == 400 %}Invalid request{% elif code == 403 %}Access denied{% elif code == 404 %}Page not found{% elif code == 413 %}Source file too large{% elif code == 415 %}Unsupported file format{% elif code == 422 %}Unable to decode this list{% elif code == 429 %}Rate limit exceeded{% elif code == 502 %}Source unavailable{% elif code == 500 %}Internal server error{% else %}Unable to process request{% endif %}</h2></div></div>
<p class="error-description">{{ error.description }}</p>
<div class="error-actions"><a href="{{ url_for('index') }}" class="primary">Back to converter</a><button type="button" class="outline" data-action="try-again">Retry request</button></div>
<details class="error-details"><summary>Technical details <span aria-hidden="true">↓</span></summary><dl><div><dt>HTTP STATUS</dt><dd>{{ code }}</dd></div><div><dt>METHOD</dt><dd>{{ request.method }}</dd></div><div><dt>PATH</dt><dd>{{ request.path }}</dd></div></dl></details>
</section>
<div class="error-tip"><i class="signal" aria-hidden="true"></i><span>Invalid or failed conversion responses are not cached by the reverse proxy.</span></div>
{% endblock %}