Connection error
The server was temporarily unavailable. This is usually a brief network issue.
import { RefreshCcw } from "lucide-react";
import * as React from "react";
import {
isRouteErrorResponse,
useRevalidator,
useRouteError,
} from "react-router";
import { useLocation } from "react-use";
import { useUser } from "~/features/auth/core/user";
import { getSessionId } from "~/utils/session-id";
import {
ERROR_GIRL_IMAGE_PATH,
LOG_IN_URL,
SENDOU_INK_DISCORD_URL,
} from "~/utils/urls";
import { SendouButton } from "./elements/Button";
import { Image } from "./Image";
import { Main } from "./Main";
export function Catcher() {
const error = useRouteError();
const user = useUser();
const { revalidate } = useRevalidator();
const location = useLocation();
// refresh user data to make sure it's up to date (e.g. cookie might have been removed, let's show the prompt to log back in)
React.useEffect(() => {
if (!isRouteErrorResponse(error) || error.status !== 401) return;
revalidate();
}, [revalidate, error]);
const isNetworkError =
error instanceof Error &&
(error.message.includes("Failed to fetch") ||
error.message.includes("NetworkError") ||
error.message.includes("Load failed"));
if (isNetworkError) {
return (
The server was temporarily unavailable. This is usually a brief
network issue.
There was an unexpected error. If this keeps happening, please report
it on our Discord so it can be
fixed. Include the error message below.
This page requires you to be logged in.
Your account doesn't have the required permissions to perform this
action.
Connection error
Error happened
Authentication required
Error 401 Unauthorized
Error 403 Forbidden
Error {error.status} - Page not found
Error {error.status}
Session ID: {getSessionId()}
{error.data
? `\n${JSON.stringify(JSON.parse(error.data), null, 2)}`
: null}
If you need assistance you can ask for help on{" "} our Discord
); } function ErrorGirlImage() { return (