@tanstack/query-core 4.4.0 → 4.5.0

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/query-core",
3
- "version": "4.4.0",
3
+ "version": "4.5.0",
4
4
  "description": "TODO",
5
5
  "author": "tannerlinsley",
6
6
  "license": "MIT",
package/src/query.ts CHANGED
@@ -452,7 +452,11 @@ export class Query<
452
452
  abort: abortController?.abort.bind(abortController),
453
453
  onSuccess: (data) => {
454
454
  if (typeof data === 'undefined') {
455
- onError(new Error('Query data cannot be undefined') as any)
455
+ onError(
456
+ new Error(
457
+ `Query data cannot be undefined - affected query key: ${this.queryHash}`,
458
+ ) as any,
459
+ )
456
460
  return
457
461
  }
458
462
 
@@ -816,7 +816,11 @@ describe('query', () => {
816
816
 
817
817
  await sleep(10)
818
818
 
819
- const error = new Error('Query data cannot be undefined')
819
+ const error = new Error(
820
+ `Query data cannot be undefined - affected query key: ${
821
+ observer.getCurrentQuery().queryHash
822
+ }`,
823
+ )
820
824
 
821
825
  expect(observerResult).toMatchObject({
822
826
  isError: true,