@tanstack/react-router 1.97.17 → 1.97.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -29,7 +29,9 @@ function validateSearch(validateSearch2, input) {
29
29
  if (result instanceof Promise)
30
30
  throw new SearchParamError("Async validation not supported");
31
31
  if (result.issues)
32
- throw new SearchParamError(JSON.stringify(result.issues, void 0, 2));
32
+ throw new SearchParamError(JSON.stringify(result.issues, void 0, 2), {
33
+ cause: result
34
+ });
33
35
  return result.value;
34
36
  }
35
37
  if ("parse" in validateSearch2) {
@@ -1492,9 +1494,12 @@ class Router {
1492
1494
  void 0
1493
1495
  ];
1494
1496
  } catch (err) {
1495
- const searchParamError = new SearchParamError(err.message, {
1496
- cause: err
1497
- });
1497
+ let searchParamError = err;
1498
+ if (!(err instanceof SearchParamError)) {
1499
+ searchParamError = new SearchParamError(err.message, {
1500
+ cause: err
1501
+ });
1502
+ }
1498
1503
  if (opts == null ? void 0 : opts.throwOnError) {
1499
1504
  throw searchParamError;
1500
1505
  }