Skip to content

Commit 512c2d5

Browse files
authored
fix: catch error (#960)
* fix: catch error * fix: add tooltip
1 parent c94adbf commit 512c2d5

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

frontend/app/project/[projectId]/traces/page.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ export default async function TracesPage(props: { params: Promise<{ projectId: s
2626
traceType: "DEFAULT",
2727
},
2828
projectId,
29+
}).catch((e) => {
30+
console.error(e);
31+
return [{ exists: 1 }];
2932
});
3033

3134
const cookieStore = await cookies();

frontend/components/evaluations/evaluations.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"use client";
22

33
import { ColumnDef } from "@tanstack/react-table";
4-
import { flow } from "lodash";
54
import { useParams, usePathname, useRouter, useSearchParams } from "next/navigation";
65
import { usePostHog } from "posthog-js/react";
76
import React, { useCallback, useMemo, useState } from "react";
@@ -12,6 +11,7 @@ import ProgressionChart from "@/components/evaluations/progression-chart";
1211
import DataTableFilter, { DataTableFilterList } from "@/components/ui/datatable-filter";
1312
import { ColumnFilter } from "@/components/ui/datatable-filter/utils";
1413
import DeleteSelectedRows from "@/components/ui/DeleteSelectedRows";
14+
import JsonTooltip from "@/components/ui/json-tooltip.tsx";
1515
import { useUserContext } from "@/contexts/user-context";
1616
import { AggregationFunction, aggregationLabelMap } from "@/lib/clickhouse/types";
1717
import { Evaluation } from "@/lib/evaluation/types";
@@ -47,10 +47,8 @@ const columns: ColumnDef<Evaluation>[] = [
4747
{
4848
accessorKey: "metadata",
4949
header: "Metadata",
50-
accessorFn: flow(
51-
(row: Evaluation) => row.metadata,
52-
(metadata) => (metadata ? JSON.stringify(metadata) : "-")
53-
),
50+
accessorFn: (row) => row.metadata,
51+
cell: (row) => <JsonTooltip data={row.getValue()} columnSize={row.column.getSize()} />,
5452
},
5553
{
5654
header: "Created at",

0 commit comments

Comments
 (0)