- Notifications
You must be signed in to change notification settings - Fork329
refactor: addErrMessageTooBig
sentinel error for limited reads#535
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Deferring approval to@mafredri
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Considering this code-path closes the connection, what use-case are we addressing by detecting the specific error?
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
The exact use-case is for better logging here: It was previously decided to log at a |
ErrMessageTooBig
sentinel error for limited reads7d7c644
intomasterUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
This change allows detecting when a message exceeds the maximum allowed size
during reads via
errors.Is(err, ErrMessageTooBig)
. Previously, this conditionrequired string matching against the error message. For backwards compatibility,
the old message is preserved in the error chain.