Classes: RedirectError

RedirectError


new RedirectError(path [, message])

A special Error type that can be used inside prepare functions of components. When thrown inside a prepare function, it will be caught and cause a redirect. On the server, this redirect will be a 302. On the client, this redirect will be a pushState (and might execute after component render).

Parameters:
Name Type Argument Description
path string

The path to redirect to

message string <optional>

A message to set on the Error. If not given, will add a default message

Source: