FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add section on error reporting to coding guidelines by kinkie · Pull Request #48 · squid-cache/squid-cache.github.io · GitHub

Add section on error reporting to coding guidelines - #48

Open
kinkie wants to merge 1 commit into
mainfrom
coding-guidelines-error-reporting
Open

Add section on error reporting to coding guidelines#48
kinkie wants to merge 1 commit into
mainfrom
coding-guidelines-error-reporting

Conversation

kinkie commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

No description provided.

kinkie changed the base branch from update-coding-guidelines to main June 21, 2026 20:50
rousskov self-requested a review June 22, 2026 00:29

To report an error and abort the current transaction, throw a `TextException("descriptive text", Here())`.
Use `Assure(condition)` to test an invariant and abort the current transaction.
To check system-leve invariants, where a failure needs to terminate Squid, use `xassert(condition)`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality
Suggested change
To check system-leve invariants, where a failure needs to terminate Squid, use `xassert(condition)`
To check system-level invariants, where a failure needs to terminate Squid, use `xassert(condition)`

yadij commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

There is also static_assert for compile-time invariant. Alex has some very specific requirements about wording the descriptions there.

It would be useful to mention what "report" means: where, how, and what does it look like for each of these cases?

Also, IIRC Alex had a definition of "invariant" that did not quite line up with C/C++ standard definition of the terminology. I came away from the Must() vs Assure() discussion thinking there was a disjoint paradigm in play.

rousskov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I welcome this attempt at documenting error handling and invariant checking guidelines. Related code is often problematic, and documentation can help reduce the number of problems and correction overheads.

There is at least one bug and several problematic statements in the current version. It is also very difficult to derive the correct decision making algorithm from the proposed sentences. As Amos has noted, it is probably best to cover static_assert cases here as well.

I will find the time to rewrite this. I do not recommend making changes until then.

kinkie commented Jun 23, 2026

Copy link
Copy Markdown
Contributor Author

I welcome this attempt at documenting error handling and invariant checking guidelines. Related code is often problematic, and documentation can help reduce the number of problems and correction overheads.

It's more than this. Coding Guidelines can (and should) feed LLMs, both code-writing and code-reviewing ones.

There is at least one bug and several problematic statements in the current version. It is also very difficult to derive the correct decision making algorithm from the proposed sentences. As Amos has noted, it is probably best to cover static_assert cases here as well.

I will find the time to rewrite this. I do not recommend making changes until then.

Feel free to improve

rousskov commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Francesco: Feel free to improve

@kinkie, I found my notes and started working on porting them here, but I will need to find more time.

P.S. I am not allowed to push to your branch.

kinkie commented Jul 4, 2026

Copy link
Copy Markdown
Contributor Author

Francesco: Feel free to improve

@kinkie, I found my notes and started working on porting them here, but I will need to find more time.

Thanks!
It's not urgent, take your time.

P.S. I am not allowed to push to your branch.

Can you now? I've added committers as maintainers for this repository

rousskov commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

P.S. I am not allowed to push to your branch.

Can you now? I've added committers as maintainers for this repository

No, I cannot.

remote: error: GH006: Protected branch update failed for refs/heads/coding-guidelines-error-reporting.
remote: 
remote: - Changes must be made through a pull request.

Initially, I thought that you needed to follow GitHub instructions, but I now realize that there is another/bigger problem here: You have created a pull request branch in the official repository instead of using your own repository.

My recommendation is to keep this PR "as is" for now. I will post an alternative PR that starts with your changes. It will use an unofficial branch, of course. If that PR looks promising, we will close this PR and delete its official branch while collaborating on that alternative PR.

kinkie commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

nitially, I thought that you needed to follow GitHub instructions, but I now realize that there is another/bigger problem here: You have created a pull request branch in the official repository instead of using your own repository.

I have used Github's "edit" feature. Unless I did something wrong, I suppose that the feature may not be good for us

kinkie commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

I will post an alternative PR that starts with your changes

Sounds good, thanks.

rousskov commented Jul 7, 2026
edited
Loading

Copy link
Copy Markdown
Contributor

I now realize that there is another/bigger problem here: You have created a pull request branch in the official repository instead of using your own repository.

I have used Github's "edit" feature. Unless I did something wrong, I suppose that the feature may not be good for us

You are probably right. I have not checked, but I suspect that:

  1. GitHub's "edit feature" should not be used on the official repository. It is wrong to create temporary/PR branches here, essentially abusing your write privileges.

  2. GitHub's "edit feature" may be used on your fork of the official repository. I do not know how easy it would be to generate a pull request against the official repository after such GitHub-UI-brokered edits, but I am pretty sure it would be easy (because it is easy to do when creating/editing branches in a forked repository the "old school" or "git" way).

The ball is on my side to post that "alternative PR that starts with your changes".

Copy link
Copy Markdown
Contributor

The ball is on my side to post that "alternative PR that starts with your changes".

Done at #50.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL