Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cli): improve error message in case sanity telemetry enable fails #5416

Merged
merged 1 commit into from
Dec 21, 2023

Conversation

bjoerge
Copy link
Member

@bjoerge bjoerge commented Dec 21, 2023

Description

Currently, if sanity telemetry enable fails, you'll get a quite unhelpful stack trace printed to the terminal. This PR improves the error formatting and forwards the error message given by the API.

What to review

  • This one is a bit tricky to test live – feel free to reach out to me for any details. I've verified that it works as intended.
  • Note: I also removed some of the env var based mocking code that were left in here as I don't think it's that relevant anymore. Preferable this should be moved into unit tests and be run against mocked API responses.

Notes for release

  • Improved message in case of an error with enabling telemetry consent

@bjoerge bjoerge requested a review from a team as a code owner December 21, 2023 09:24
@bjoerge bjoerge requested review from binoy14 and removed request for a team December 21, 2023 09:24
Copy link

vercel bot commented Dec 21, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
performance-studio ✅ Ready (Inspect) Visit Preview Dec 21, 2023 9:24am
test-studio ✅ Ready (Inspect) Visit Preview Dec 21, 2023 9:24am
1 Ignored Deployment
Name Status Preview Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Dec 21, 2023 9:24am

Copy link
Contributor

Package Documentation Change
sanity -3%
Full Report
@sanity/diff
This branch Next branch
13 documented 13 documented
16 not documented 16 not documented
@sanity/block-tools
This branch Next branch
4 documented 4 documented
9 not documented 9 not documented
@sanity/types
This branch Next branch
54 documented 54 documented
235 not documented 235 not documented
sanity/desk
This branch Next branch
86 documented 86 documented
60 not documented 60 not documented
@sanity/portable-text-editor
This branch Next branch
21 documented 21 documented
44 not documented 44 not documented
@sanity/mutator
This branch Next branch
7 documented 7 documented
4 not documented 4 not documented
@sanity/cli
This branch Next branch
1 documented 1 documented
31 not documented 31 not documented
@sanity/schema/_internal
This branch Next branch
0 documented 0 documented
9 not documented 9 not documented
@sanity/util/paths
This branch Next branch
1 documented 1 documented
15 not documented 15 not documented
sanity/router
This branch Next branch
17 documented 17 documented
26 not documented 26 not documented
@sanity/util/legacyDateFormat
This branch Next branch
0 documented 0 documented
3 not documented 3 not documented
@sanity/schema
This branch Next branch
0 documented 0 documented
2 not documented 2 not documented
sanity/cli
This branch Next branch
2 documented 2 documented
0 not documented 0 not documented
@sanity/vision
This branch Next branch
0 documented 0 documented
3 not documented 3 not documented
@sanity/util/fs
This branch Next branch
0 documented 0 documented
3 not documented 3 not documented
sanity/_internal
This branch Next branch
0 documented 0 documented
1 not documented 1 not documented
@sanity/util/content
This branch Next branch
1 documented 1 documented
5 not documented 5 not documented
sanity
This branch Next branch
173 documented 180 documented
841 not documented 849 not documented

Copy link
Contributor

Component Testing Report Updated Dec 21, 2023 9:32 AM (UTC)

File Status Duration Passed Skipped Failed
comments/CommentInput.spec.tsx ✅ Passed (Inspect) 34s 15 0 0
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 6s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ✅ Passed (Inspect) 12s 3 0 0
formBuilder/inputs/PortableText/copyPaste/CopyPaste.spec.tsx ✅ Passed (Inspect) 13s 4 2 0
formBuilder/inputs/PortableText/Decorators.spec.tsx ✅ Passed (Inspect) 13s 6 0 0
formBuilder/inputs/PortableText/FocusTracking.spec.tsx ✅ Passed (Inspect) 34s 15 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 18s 9 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 1m 4s 18 0 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 13s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ✅ Passed (Inspect) 7s 3 0 0

@bjoerge bjoerge added this pull request to the merge queue Dec 21, 2023
Merged via the queue into next with commit 8eaea18 Dec 21, 2023
38 of 40 checks passed
@bjoerge bjoerge deleted the fix/improve-consent-change-error-handling branch December 21, 2023 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants