mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-10-10 21:44:16 +00:00
26 lines
538 B
TypeScript
26 lines
538 B
TypeScript
"use client";
|
|
|
|
import { useEffect } from "react";
|
|
|
|
export default function Error({ error, reset }: { error: Error; reset: () => void }) {
|
|
useEffect(() => {
|
|
// Log the error to an error reporting service
|
|
/* eslint-disable no-console */
|
|
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>
|
|
);
|
|
}
|