{
render(): JSX.Element {
return (
An error occurred: {this.props.message}
);
}
}
export async function main() {
try {
const url = URI(document.location.href);
const query: any = URI.parseQuery(url.query());
const message: string = query.message || "unknown error";
ReactDOM.render(, document.getElementById(
"container")!);
} catch (e) {
// TODO: provide more context information, maybe factor it out into a
// TODO:generic error reporting function or component.
document.body.innerText = `Fatal error: "${e.message}".`;
console.error(`got error "${e.message}"`, e);
}
}