Fix bot review

Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
Émile Ré
2026-01-22 21:06:19 +04:00
parent 7dd5e1666d
commit 4d80dccbbf
5 changed files with 9 additions and 19 deletions

View File

@@ -37,7 +37,7 @@ jobs:
cache: "npm"
- name: Update npm
- run: "npm i -g npm@11.8.0"
run: npm i -g npm@11.8.0
- name: Install dependencies
run: npm ci

View File

@@ -14,7 +14,7 @@ const classNames = {
type Props = {
resetErrorBoundary?: () => void;
error?: string;
error?: Error;
};
export function PageError({ resetErrorBoundary, error: propsError }: Props) {

View File

@@ -1,9 +1,7 @@
import { Role } from "@probo/helpers";
import { lazy } from "@probo/react-lazy";
import {
ForbiddenError,
UnAuthenticatedError,
UnauthorizedError,
} from "@probo/relay";
import { type AppRoute, routeFromAppRoute } from "@probo/routes";
import { CenteredLayout } from "@probo/ui";
@@ -42,22 +40,14 @@ import { vendorRoutes } from "./routes/vendorRoutes";
/**
* Top level error boundary
*/
function ErrorBoundary({ error: propsError }: { error?: string }) {
const error = useRouteError() ?? propsError;
function ErrorBoundary() {
const error = useRouteError();
if (error instanceof UnAuthenticatedError) {
return <Navigate to="/auth/login" />;
}
if (error instanceof UnauthorizedError) {
return <PageError error="UNAUTHORIZED" />;
}
if (error instanceof ForbiddenError) {
return <PageError error="FORBIDDEN" />;
}
return <PageError error={error instanceof Error ? error.message : ""} />;
return <PageError error={error instanceof Error ? error : new Error("unkown error")} />;
}
const routes = [

View File

@@ -13,7 +13,7 @@ const classNames = {
type Props = {
resetErrorBoundary?: () => void;
error?: string;
error?: Error;
};
export function PageError({ resetErrorBoundary, error: propsError }: Props) {

View File

@@ -26,10 +26,10 @@ import { consoleEnvironment } from "./providers/RelayProviders.tsx";
/**
* Top level error boundary
*/
function ErrorBoundary({ error: propsError }: { error?: string }) {
const error = useRouteError() ?? propsError;
function ErrorBoundary() {
const error = useRouteError();
return <PageError error={error instanceof Error ? error.message : ""} />;
return <PageError error={error instanceof Error ? error : new Error("unkown error")} />;
}
const routes = [