Skip to content

Fix Go's error handling #2

@knocte

Description

@knocte

(I'm really glad someone is trying to fix Go, even if it's from a transpiler perspective. E.g.: I really like the fact that you support Generics.)

Now, it would be great if you could fix error handling in Go. It has several disadvantages, such as the default not being safe (ignoring errors), and that it's easy to lose context (stacktrace) when propagating errors with new errors.

There's a good discussion about this here:
https://news.ycombinator.com/item?id=12563887

This talk is also interesting because it highlights the common mistakes of Go devs when using error handling, and how difficult is to do it properly: https://www.youtube.com/watch?v=lsBF58Q-DnY (at the end of the talk, the speaker goes ahead and recommends the usage of an error-utility-library he implemented himself, maybe Have's best approach would just be code generation that makes use of this library? or maybe some kind of try-catch approach...).

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions