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

Systematize error-issuing and other printing functions #2129

Open
sauclovian-g opened this issue Oct 12, 2024 · 1 comment
Open

Systematize error-issuing and other printing functions #2129

sauclovian-g opened this issue Oct 12, 2024 · 1 comment
Assignees
Labels
tech debt Issues that document or involve technical debt topics: error-handling Issues involving the way SAW responds to an error condition topics: error-messages Issues involving the messages SAW produces on error

Comments

@sauclovian-g
Copy link
Collaborator

Right now errors are printed and ensuing aborts taken through an incredible variety of functions, some of which print, some of which throw things meant to be printed, some of which apparently do both, some of which allow position reporting (others don't). There's also a whole second variety of functions for random prints that don't directly cause failure. This should all get systematized; we ought to have one function for panics and a small number more for messages of various types and severities, all defined in one place, and everything should use only those functions.

This offers a whole range of benefits, not limited to:

  • make it possible to find all the prints
  • make sure position reporting is possible in all contexts
  • make position formatting consistent everywhere
  • reduce the amount of code on hard-to-test error paths
  • make sure anything that should be printed along with each message (such as "please file a bug report") actually is

Interconnected with #2128. Also more or less a prerequisite for #2075.

@sauclovian-g sauclovian-g added topics: error-messages Issues involving the messages SAW produces on error tech debt Issues that document or involve technical debt topics: error-handling Issues involving the way SAW responds to an error condition labels Oct 12, 2024
@sauclovian-g sauclovian-g self-assigned this Oct 12, 2024
@sauclovian-g
Copy link
Collaborator Author

Also, there should be a framework for status reporting (in the sense of: we are running, what are we doing, what progress are we making) which is both part of this (since it's about printing) but quite distinct from errors and warnings.

(Plus there should be support for selective dumping of internal representations, and support for logging and tracing, all of which are also related but quite distinct in nature.)

These additional printing topics didn't make it into the original description because (a) they're optional in a way that error reporting isn't, and (b) we don't have much in the way of such infrastructure or such printing currently so the need isn't as immediate. However, review of the situation has made it clear that to the extent we don't have these things, that's a problem and we should.

Re logging in particular there's a long-standing request for that in #870.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tech debt Issues that document or involve technical debt topics: error-handling Issues involving the way SAW responds to an error condition topics: error-messages Issues involving the messages SAW produces on error
Projects
None yet
Development

No branches or pull requests

1 participant