pub fn new(
        handler: impl Fn(Scope, ClientError, ErrorContext, ErrorPosition) -> (View<SsrNode>, View<G>)
            + Send
            + Sync
            + Clone
            + 'static,
    ) -> Self {
        #[allow(clippy::redundant_clone)]
        Self {
            handler: Box::new(handler.clone()),
            // Sensible defaults are fine here
            subsequent_load_determinant: Box::new(|err| {
                match err {
                    // Any errors from the server should take up the whole page
                    ClientError::ServerError { .. } => true,
                    // Anything else is internal-ish (e.g. a fetch failure would be a network
                    // failure, so we keep the user where they are)
                    _ => false,
                }
            }),
            #[cfg(any(client, doc))]
            panic_handler: Arc::new(handler),
        }
    }
Creates an error handling system for your app with the given handler
function. This will be provided a [`ClientError`] to match against,
along with an [`ErrorContext`], which tells you what you have available
to you (since, in some critical errors, you might not even have a
translator).

The function given to this should return a tuple of two `View`s: the
first to be placed in document `<head>`, and the second
for the body. For views with `ErrorPosition::Popup` or
`ErrorPosition::Widget`, the head view will be ignored,
and would usually be returned as `View::empty()`.
packages/perseus/src/error_views.rs