// For parameter validation errors, provide specific error feedback
logConsoleAndDb(`[DeepLink] Invalid parameters for route name ${routeName} for path: ${path}: ${JSON.stringify(error)} ... with params: ${JSON.stringify(params)} ... and query: ${JSON.stringify(query)}`,true);
awaitthis.router.replace({
name:"deep-link-error",
params,
query:{
originalPath: path,
errorCode:"INVALID_PARAMETERS",
errorMessage:`The link parameters are invalid: ${(errorasError).message}`,
...query,
},
});
// This previously threw an error but we're redirecting so there's no need.
return;
}
try{
awaitthis.router.replace({
name: routeName,
params: validatedParams,
query,
query: validatedQuery,
});
}catch(error){
logConsoleAndDb(`[DeepLink] Error routing to route name ${routeName} for path: ${path}: ${JSON.stringify(error)} ... with validated params: ${JSON.stringify(validatedParams)} ... and validated query: ${JSON.stringify(validatedQuery)}`,true);
// For parameter validation errors, provide specific error feedback
awaitthis.router.replace({
name:"deep-link-error",
params: validatedParams,
query:{
originalPath: path,
errorCode:"INVALID_PARAMETERS",
message:`The link parameters are invalid: ${(errorasError).message}`,
errorCode:"ROUTING_ERROR",
errorMessage:`Error routing to ${routeName}: ${(JSON.stringify(error))}`,
...validatedQuery,
},
});
throw{
code:"INVALID_PARAMETERS",
message:(errorasError).message,
details: error,
params: params,
query: query,
};
}
}
/**
@ -236,7 +248,6 @@ export class DeepLinkHandler {
*/
asynchandleDeepLink(url: string):Promise<void>{
try{
logger.info("[DeepLink] Processing URL: "+url);
const{path,params,query}=this.parseDeepLink(url);
// Ensure params is always a Record<string,string> by converting undefined to empty string