File tree Expand file tree Collapse file tree 4 files changed +19
-7
lines changed
Expand file tree Collapse file tree 4 files changed +19
-7
lines changed Original file line number Diff line number Diff line change 22
33import clsx from "clsx" ;
44import { ChatAreaContainer } from "./chat/[chatId]/chatArea" ;
5- import { useEffect } from "react" ;
5+ import { useEffect , useState } from "react" ;
66import { captureException } from "@sentry/nextjs" ;
77
88export default function Error ( {
@@ -12,8 +12,9 @@ export default function Error({
1212 error : Error & { digest ?: string } ;
1313 reset : ( ) => void ;
1414} ) {
15+ const [ eventId , setEventId ] = useState < string > ( ) ;
1516 useEffect ( ( ) => {
16- captureException ( error ) ;
17+ setEventId ( captureException ( error ) ) ;
1718 } , [ error ] ) ;
1819
1920 return (
@@ -32,6 +33,9 @@ export default function Error({
3233 Digest: { error . digest }
3334 </ p >
3435 ) }
36+ { eventId && (
37+ < p className = "mt-2 text-sm text-base-content/50" > eventID: { eventId } </ p >
38+ ) }
3539 </ ChatAreaContainer >
3640 ) ;
3741}
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ export default function WorkspaceLayout({
1515 return (
1616 < StreamingChatProvider >
1717 < ChatAreaStateProvider >
18- < div className = "w-full flex flex-row" >
18+ < div className = "flex-1 w-full flex flex-row" >
1919 { docs }
2020
2121 { chat }
Original file line number Diff line number Diff line change 33import { captureException } from "@sentry/nextjs" ;
44import clsx from "clsx" ;
55import Link from "next/link" ;
6- import { useEffect } from "react" ;
6+ import { useEffect , useState } from "react" ;
77
88export default function ErrorPage ( {
99 error,
@@ -12,8 +12,9 @@ export default function ErrorPage({
1212 error : unknown ;
1313 reset : ( ) => void ;
1414} ) {
15+ const [ eventId , setEventId ] = useState < string > ( ) ;
1516 useEffect ( ( ) => {
16- captureException ( error ) ;
17+ setEventId ( captureException ( error ) ) ;
1718 } , [ error ] ) ;
1819
1920 return (
@@ -33,6 +34,9 @@ export default function ErrorPage({
3334 Digest: { ( error as { digest : string } ) . digest }
3435 </ p >
3536 ) }
37+ { eventId && (
38+ < p className = "mt-2 text-sm text-base-content/50" > eventID: { eventId } </ p >
39+ ) }
3640 < div className = "divider w-full self-auto!" />
3741 < div className = "flex flex-row gap-4" >
3842 < button
Original file line number Diff line number Diff line change 33import { captureException } from "@sentry/nextjs" ;
44import clsx from "clsx" ;
55import Link from "next/link" ;
6- import { useEffect } from "react" ;
6+ import { useEffect , useState } from "react" ;
77
88export default function ErrorPage ( {
99 error,
@@ -12,8 +12,9 @@ export default function ErrorPage({
1212 error : unknown ;
1313 reset : ( ) => void ;
1414} ) {
15+ const [ eventId , setEventId ] = useState < string > ( ) ;
1516 useEffect ( ( ) => {
16- captureException ( error ) ;
17+ setEventId ( captureException ( error ) ) ;
1718 } , [ error ] ) ;
1819
1920 return (
@@ -33,6 +34,9 @@ export default function ErrorPage({
3334 Digest: { ( error as { digest : string } ) . digest }
3435 </ p >
3536 ) }
37+ { eventId && (
38+ < p className = "mt-2 text-sm text-base-content/50" > eventID: { eventId } </ p >
39+ ) }
3640 < div className = "divider w-full self-auto!" />
3741 < div className = "flex flex-row gap-4" >
3842 < button
You can’t perform that action at this time.
0 commit comments