feat(server): Add basePath config to host from a directory (#2092)
Co-authored-by: Marvin Hagemeister <marvin@deno.com>
This commit is contained in:
co-authored by
Marvin Hagemeister
parent
fe792455ab
commit
9ab8651018
@@ -0,0 +1,27 @@
|
||||
import { Component } from "preact";
|
||||
|
||||
class ErrorBoundary extends Component {
|
||||
state = { error: null } as { error: Error | null };
|
||||
|
||||
static getDerivedStateFromError(error: Error) {
|
||||
return { error };
|
||||
}
|
||||
|
||||
render() {
|
||||
return this.state.error
|
||||
? <p>{this.state.error.message}</p>
|
||||
: <>{this.props.children}</>;
|
||||
}
|
||||
}
|
||||
|
||||
function Thrower(): preact.JSX.Element {
|
||||
throw new Error("it works");
|
||||
}
|
||||
|
||||
export default function ErrorBoundaryPage() {
|
||||
return (
|
||||
<ErrorBoundary>
|
||||
<Thrower />
|
||||
</ErrorBoundary>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user