Skip to content

crelte / server / mainError

Function: mainError()

ts
function mainError(data): Promise<{
  html?: string;
  status: number;
}>;

The main function to start the server side rendering if there was an error

Example

js
import * as errorPage from './Error.svelte';

export function renderError(error, serverData) {
    return mainError({
        error,
        errorPage,
        serverData
    });
}

Parameters

data

MainErrorData

Returns

Promise<{ html?: string; status: number; }>