Providing more information when throwing an error in the case of undefined query data being returned
#6948
Unanswered
samueljoli
asked this question in
Q&A
Replies: 1 comment 2 replies
-
one problem is that those rather long strings stay in the final bundle as-is, so we've tried to keep it to a minimum and rather log during dev mode. Now we could throw a different error with more info in dev mode if that helps:
because this will be removed by bundlers. However, then we have different errors in dev and prod, so not sure if that doesn't have any drawbacks 😅 |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Currently, in
v4
when no data is being returned from a query it passes an error like so to anonError
callback:I don't typically have my logger turned on during testing so it took me a second to figure out what the issue was. It turned out to be an improperly configured url being passed to
jest-when
hence the api call wasn't being properly mocked to return the expected results. I guess I should have just turned on my logger and this would have surfaced. I would imagine this being the recommended debugging protocol, but I wonder if it would make sense to provide just a tad bit more context in the error being thrown for those of use who don't instinctively turn on our loggers during testing.suggestion:
Related to: #4218
Beta Was this translation helpful? Give feedback.
All reactions