Skip to content

Go2ErrorHandlingFeedback

Ian Lance Taylor edited this page May 31, 2019 · 185 revisions

Feedback re Go 2 Error Handling Draft Design

This page is meant to collect and organize feedback about the Go 2 error handling draft design.

Please post feedback on your blog, Medium, GitHub Gists, mailing lists, Google Docs, etc. And then please link it here.

Please help categorize the rest of the uncategorized proposals at the bottom.

Requirements

Discussions of the requirements for a new error handling method.

In support

This includes supporting the existing chaining/stacking of handlers without changes.

Example code

Code changed to use the existing proposal.

Against

Critiques without counter-proposals

Recurring themes

Concepts that appear repeatedly among the suggestions below.

  • Invoke handler via assignment, e.g. v, ? := f()
    references: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13

  • Invoke one of several handlers by name, e.g. v, ?name := f()
    references: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17

Modest revisions

Remove handler chaining

Counter-proposals

Error handling with normal functions

Labeled error handlers

Inlining

Use defer

try/catch/finally syntax

Other possibilities

Uncategorized

Please help categorize the rest of the proposals here.

Adding your feedback

Please format all entries as below.

  • Your Name, “Title”, month year

To make it easier to see new feedback, please add your new proposal to the top of the section it is placed in.

Clone this wiki locally