more auth ree
This commit is contained in:
@@ -26,6 +26,14 @@ export const toServerResult = async <T>(
|
||||
const data = await serverFn();
|
||||
return { success: true, data };
|
||||
} catch (error) {
|
||||
if (error && typeof error === 'object' && 'options' in error) {
|
||||
const redirectError = error as any;
|
||||
if (redirectError.options?.to && redirectError.options?.statusCode) {
|
||||
logger.info('toServerResult: Re-throwing TanStack Router redirect', redirectError.options);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
const duration = Date.now() - startTime;
|
||||
logger.error('Server Fn Error', error);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user