[BEAM-7154] Updating Go SDK errors (Part 2)#8462
Conversation
|
R: @lostluck |
|
Mostly LGTM, but we must fix the pre-commit first: 16:34:36 > Task :beam-sdks-go:goTest FAILED |
|
Strange, I ran goTest on my machine and it didn't catch any errors. I wonder if there's something different between my local environment and the Jenkins environment. Anyway, fixed those so it should work now hopefully. |
|
That's almost certainly the case, given the whole GoGradle, Versioning, Etc. situation the SDK is in. I do not recommend testing with the gradle commands locally under the vast majority of cases.
|
This commit changes errors from using standard Go error functionality to using the internal Beam "errors" package. it covers the subdirectories io, options, provision, and runners.
|
@aaltay for merge. |
Updating standard Go error functionality (
errors.Newandfmt.Errorf) to use the newly added Beam "errors" package. This PR covers the following subdirectories undersdks/go/pkg/beam:io,options,provision, andrunners.I tried to keep the actual changes as straightforward as possible:
NeworErrorf. This should be functionally identical.WraporWithContextusing my best judgement. I generally usedWrapwhen the wrapped error originates from third-party code (i.e. any non-Beam package), and I tried to useWithContextotherwise.WithContextmessages 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.Only PR left after this is for the
coresubdirectory. That one might be a bit large so I wanted to separate it.Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
R: @username).[BEAM-XXX] Fixes bug in ApproximateQuantiles, where you replaceBEAM-XXXwith the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.Post-Commit Tests Status (on master branch)
Pre-Commit Tests Status (on master branch)
See .test-infra/jenkins/README for trigger phrase, status and link of all Jenkins jobs.