Skip to content

[BEAM-7154] Updating Go SDK errors (Part 3 - Final)#8560

Merged
akedin merged 1 commit intoapache:masterfrom
youngoli:beam7154-2
May 15, 2019
Merged

[BEAM-7154] Updating Go SDK errors (Part 3 - Final)#8560
akedin merged 1 commit intoapache:masterfrom
youngoli:beam7154-2

Conversation

@youngoli
Copy link
Contributor

Updating standard Go error functionality (errors.New and fmt.Errorf) to use the newly added Beam "errors" package. This PR covers the core subdirectory under sdks/go/pkg/beam.

I tried to keep the actual changes as straightforward as possible:

  1. If a call isn't wrapping another error, replace it with New or Errorf. This should be functionally identical.
  2. If a call is wrapping another error, replace it with either Wrap or WithContext using my best judgement. I generally used Wrap when the wrapped error originates from third-party code (i.e. any non-Beam package), and I tried to use WithContext otherwise.
  3. WithContext messages make the most sense in present tense (e.g. "doing foo", "reading bar"). This means I had to adjust some messages slightly, as little as I could without losing any useful information.
  4. For existing error messages that combined context and errors, I moved the context part to a separate line using WithContext, to improve legibility.

This is the last PR for migrating to the new errors package.


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Choose reviewer(s) and mention them in a comment (R: @username).
  • Format the pull request title like [BEAM-XXX] Fixes bug in ApproximateQuantiles, where you replace BEAM-XXX with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

Post-Commit Tests Status (on master branch)

Lang SDK Apex Dataflow Flink Gearpump Samza Spark
Go Build Status --- --- --- --- --- ---
Java Build Status Build Status Build Status Build Status
Build Status
Build Status
Build Status Build Status Build Status
Python Build Status
Build Status
--- Build Status
Build Status
Build Status --- --- ---

Pre-Commit Tests Status (on master branch)

--- Java Python Go Website
Non-portable Build Status Build Status Build Status Build Status
Portable --- Build Status --- ---

See .test-infra/jenkins/README for trigger phrase, status and link of all Jenkins jobs.

@youngoli
Copy link
Contributor Author

R: @lostluck

Copy link
Contributor

@lostluck lostluck left a comment

Choose a reason for hiding this comment

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

LGTM
R: @aaltay please merge. Thanks!

@akedin akedin merged commit 4f9361b into apache:master May 15, 2019
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