-
Notifications
You must be signed in to change notification settings - Fork 881
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add rsshub discover error boundary
Signed-off-by: Innei <tukon479@gmail.com>
- Loading branch information
Showing
8 changed files
with
61 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import type { FC } from "react" | ||
|
||
import { attachOpenInEditor } from "~/lib/dev" | ||
|
||
import type { AppErrorFallbackProps } from "../common/AppErrorBoundary" | ||
import { FeedbackIssue } from "../common/ErrorElement" | ||
import { parseError } from "./helper" | ||
|
||
const RSSHubErrorFallback: FC<AppErrorFallbackProps> = (props) => { | ||
const { message, stack } = parseError(props.error) | ||
|
||
return ( | ||
<div className="flex flex-col items-center justify-center"> | ||
<div className="m-auto max-w-prose text-center"> | ||
<p className="center my-3 gap-2 font-bold"> | ||
<i className="i-mgc-bug-cute-re text-red-500" /> | ||
RSSHub has a temporary problem, please contact the our team. | ||
</p> | ||
<div className="text-lg">{message}</div> | ||
{import.meta.env.DEV && stack ? ( | ||
<pre className="mt-4 max-h-48 cursor-text overflow-auto whitespace-pre-line rounded-md bg-red-50 p-4 text-left font-mono text-sm text-red-600"> | ||
{attachOpenInEditor(stack)} | ||
</pre> | ||
) : null} | ||
|
||
<FeedbackIssue message={message!} stack={stack} /> | ||
</div> | ||
</div> | ||
) | ||
} | ||
export default RSSHubErrorFallback |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters