fix: melhora mensagem de erro de conexão no portal
- Substitui mensagem técnica por "Não foi possível conectar ao servidor" - Muda cor do alerta de vermelho para âmbar (menos alarmante) - Remove detalhes técnicos do erro (ficam apenas no console) - Adiciona dica para verificar conexão com internet 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
69bb9b8acf
commit
2b17d278f1
2 changed files with 6 additions and 12 deletions
|
|
@ -145,17 +145,11 @@ export function PortalShell({ children }: PortalShellProps) {
|
||||||
</header>
|
</header>
|
||||||
<main className="mx-auto flex w-full max-w-6xl flex-1 flex-col gap-6 px-6 py-8">
|
<main className="mx-auto flex w-full max-w-6xl flex-1 flex-col gap-6 px-6 py-8">
|
||||||
{machineContextError ? (
|
{machineContextError ? (
|
||||||
<div className="rounded-xl border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700 shadow-sm">
|
<div className="rounded-xl border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-700 shadow-sm">
|
||||||
<p className="font-semibold text-red-800">Falha ao carregar os dados do colaborador vinculado.</p>
|
<p className="font-semibold text-amber-800">Não foi possível conectar ao servidor.</p>
|
||||||
<p className="mt-1 text-xs text-red-700/80">
|
<p className="mt-1 text-xs text-amber-700/80">
|
||||||
{machineContextError.message}
|
Verifique sua conexão com a internet e tente novamente em alguns instantes.
|
||||||
{machineContextError.status ? ` (status ${machineContextError.status})` : null}
|
|
||||||
</p>
|
</p>
|
||||||
{machineContextError.details && Object.keys(machineContextError.details).length > 0 ? (
|
|
||||||
<pre className="mt-2 overflow-x-auto rounded-lg bg-red-100 px-3 py-2 text-[11px] leading-tight text-red-800">
|
|
||||||
{JSON.stringify(machineContextError.details, null, 2)}
|
|
||||||
</pre>
|
|
||||||
) : null}
|
|
||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
{!machineContextError && machineContextLoading ? (
|
{!machineContextError && machineContextLoading ? (
|
||||||
|
|
|
||||||
|
|
@ -226,8 +226,8 @@ export function AuthProvider({ children }: { children: React.ReactNode }) {
|
||||||
setMachineContext(null)
|
setMachineContext(null)
|
||||||
setMachineContextError({
|
setMachineContextError({
|
||||||
status: 0,
|
status: 0,
|
||||||
message: "Erro ao carregar o contexto da maquina.",
|
message: "Falha na conexão",
|
||||||
details: error instanceof Error ? { message: error.message } : null,
|
details: null, // Detalhes técnicos ficam apenas no console
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue