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

Summarize unexpected server responses #5342

Open
wants to merge 2 commits into
base: trunk
Choose a base branch
from

Conversation

hojberg
Copy link
Member

@hojberg hojberg commented Sep 11, 2024

When we hit an unexpected server response, summarize it with the status code, status message and the response body instead of dumping the raw Haskell data-structures.

This fixes #5341 though I think we should probably log the actual request and response to a file somewhere.


Excuse my poor haskell here—this is more of a draft than anything, as I'm not sure what the appropriate style is.

hojberg and others added 2 commits September 11, 2024 13:22
When we hit an unexpected server response, summarize it with the status code,
status message and the response body instead of dumping the raw Haskell
data-structures.
@hojberg hojberg marked this pull request as ready for review September 18, 2024 14:13
@aryairani
Copy link
Contributor

No worries about Haskell, but could you copy/paste or screenshot the new output for the review? (preferably before/after) or is it untested / hard to trigger?

@aryairani
Copy link
Contributor

I think we should probably log the actual request and response to a file somewhere.

We can also stash the longer message in ucm and mention a debug command to display it.

@hojberg hojberg changed the title Summary unexpected server responses Summarize unexpected server responses Sep 18, 2024
@ChrisPenner
Copy link
Contributor

My inclination would be to have add an UNISON_DEBUG env var flag for more details; that way we can easily ask users to re-run with more output enabled, and us devs can just always leave it enabled if we want.

Only downside would be if something isn't reproducible the message is lost, but if it's from a web-request I can always look up the logs to see what happened anyways 🤷🏼‍♂️

@aryairani
Copy link
Contributor

An idea that came up in our standup was to display the request id and have the user report that, and then make @ChrisPenner look up ids on the server each time. 🙃

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.

Improve error message when receiving unexpected server responses
3 participants