Skip to content

Commit

Permalink
feat: add debug on error
Browse files Browse the repository at this point in the history
  • Loading branch information
zrll12 committed Dec 19, 2023
1 parent 37b9000 commit 2686383
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions app/error.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
'use client'

import {useEffect} from 'react'
import React, {useEffect} from 'react'
import {title} from "@/components/primitives";
import {Button} from "@nextui-org/button";

export default function Error({
error,
Expand All @@ -14,16 +16,17 @@ export default function Error({
console.error(error)
}, [error])
return (
<div>
<h2>Something went wrong!</h2>
<button
onClick={
// Attempt to recover by trying to re-render the segment
() => reset()
}
>
Try again
</button>
<div className={"text-center space-y-10"}>
<h1 className={title()}>错误</h1><br/>
<div>
<a>网站发生了错误。如需帮助,请把以下内容提供给支持人员:</a><br/><br/>
<a>{error.name} in </a><br/>
<a>{error.message}</a><br/>
<a>{error.stack}</a>
</div>
<Button onClick={reset}>
重置页面
</Button>
</div>
)
}

0 comments on commit 2686383

Please sign in to comment.