2023-10-23 23:11:59 +02:00
|
|
|
"use client"
|
2023-07-31 19:06:46 +02:00
|
|
|
|
2023-10-23 23:11:59 +02:00
|
|
|
import { useEffect } from "react"
|
2023-07-31 19:06:46 +02:00
|
|
|
|
|
|
|
export interface ErrorHandlingProps {
|
|
|
|
error: Error
|
|
|
|
}
|
|
|
|
|
|
|
|
const ErrorHandling = (props: ErrorHandlingProps): JSX.Element => {
|
|
|
|
const { error } = props
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
console.error(error)
|
|
|
|
}, [error])
|
|
|
|
|
2023-08-01 18:18:16 +02:00
|
|
|
return (
|
2023-10-23 23:11:59 +02:00
|
|
|
<main className="flex flex-col flex-1 items-center justify-center">
|
|
|
|
<h1 className="my-6 text-4xl font-semibold">
|
|
|
|
Error{" "}
|
2023-08-01 18:18:16 +02:00
|
|
|
<span
|
2023-10-23 23:11:59 +02:00
|
|
|
className="text-yellow dark:text-yellow-dark"
|
|
|
|
data-cy="status-code"
|
2023-08-01 18:18:16 +02:00
|
|
|
>
|
|
|
|
500
|
|
|
|
</span>
|
|
|
|
</h1>
|
2023-10-23 23:11:59 +02:00
|
|
|
<p className="text-center text-lg">Server error</p>
|
2023-08-01 18:18:16 +02:00
|
|
|
</main>
|
|
|
|
)
|
2023-07-31 19:06:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
export default ErrorHandling
|