feat: improve get-it HTTP stacktraces#1184
Draft
jonahsnider wants to merge 2 commits into
Draft
Conversation
Signed-off-by: Jonah Snider <jonah@jonahsnider.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Contributor
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||
Signed-off-by: Jonah Snider <jonah@jonahsnider.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related to AIGRO-4516
Blocked until sanity-io/get-it#556 is merged
Description
Please see sanity-io/get-it#556 for the original context on the issue
get-it gives very vague stacktraces which don't include the original source of the error.
@sanity/clientdoes someObservablestuff which makes it hard to resolve that purely from get-it.This PR captures the state of the call stack and then passes that down to get-it, so that if an error is thrown it includes the full context.
Here's an example of an error stacktrace with and without this change:
Without this change, there's no indication as to where the error is originating from.
But when we capture the call stack before making the request, we can see that
updateDatasetTool.tsis the file that actually initiates the HTTP request that's failing!Testing
Tested locally with
pnpm link