-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Description
Describe the problem
I want to use the handleError hook of SvelteKit, but I realized that it currently has to be a synchronous function. But unfortunately, our error mapper is an asynchronous function. Since it is not possible in JavaScript to synchronously await an asynchronous function (like in C#), it seems we cannot use the handleError hook currently.
Describe the proposed solution
Make the return type of HandleServerError and HandleClientError a MaybePromise, like the handle-hook.
export interface HandleServerError {
(input: { error: unknown; event: RequestEvent }): MaybePromise<void | App.Error>;
}
export interface HandleClientError {
(input: { error: unknown; event: NavigationEvent }): MaybePromise<void | App.Error>;
}Alternatives considered
Continue not to use handleError.
Importance
would make my life easier
Additional Information
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels