0
lorentz
1y

Can the error types of my library depend on a custom library context object to be printable or otherwise meaningful? Pretty much everything else depends on this context, but until now the errors were an exception (no pun intended) because I wanted them to be printable by any handler that bumps into them, without scoping concerns. Now I tried removing them and like a third of my library has suddenly become context-free, because it only used the context to fully resolve everything before error reporting.

Comments
  • 0
    Sounds like an abstraction like SLF4J for logging, except for error handling.

    https://go.dev/blog/...

    Just as one example my sleep deprived overworked brain tried to parse from your rant...

    Defining an interface that just defines an Error as an interface in it's basic form with an function giving you a common string representation or sth like that and based on the interface possible additional abstractions which extend the possibilities?
Add Comment