Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(errors): restore matching against all original errors #213

Merged
merged 1 commit into from
Mar 21, 2024

Conversation

dpopp07
Copy link
Member

@dpopp07 dpopp07 commented Mar 21, 2024

I missed an error origination point that needed to be converted to the new format. Also, this is maybe overly cautious but I added back in the original error instances as native caused by errors for all instances. Before, I intentionally left alone places that held an error origination from fmt.Errorf() because I don't know that users can really match against those, but I figured we might as well be as compatibility-friendly as we can be, since it doesn't cost us anything.

I missed an error origination point that needed to be converted to
the new format. Also, this is maybe overly cautious but I added
back in the original error instances as native caused by errors
for all instances. Before, I intentionally left alone places that
held an error origination from `fmt.Errorf()` because I don't know
that users can really match against those, but I figured we might as
well be as compatibility-friendly as we can be, since it doesn't cost
us anything.

Signed-off-by: Dustin Popp <dpopp07@gmail.com>
@@ -143,7 +143,8 @@ func (requestBuilder *RequestBuilder) ConstructHTTPURL(serviceURL string, pathSe
// The resulting request URL: "https://myservice.cloud.ibm.com/resource/res-123-456-789-abc/type/type-1"
func (requestBuilder *RequestBuilder) ResolveRequestURL(serviceURL string, path string, pathParams map[string]string) (*RequestBuilder, error) {
if serviceURL == "" {
return requestBuilder, fmt.Errorf(ERRORMSG_SERVICE_URL_MISSING)
err := fmt.Errorf(ERRORMSG_SERVICE_URL_MISSING)
return requestBuilder, SDKErrorf(err, "", "service-url-missing", getComponentInfo())
Copy link
Member Author

Choose a reason for hiding this comment

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

This was the real issue that needed to be fixed

Copy link
Member

@padamstx padamstx left a comment

Choose a reason for hiding this comment

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

LGTM

@dpopp07 dpopp07 merged commit 005fdb8 into main Mar 21, 2024
4 checks passed
@dpopp07 dpopp07 deleted the dp/error-creation-fix branch March 21, 2024 19:59
ibm-devx-sdk pushed a commit that referenced this pull request Mar 21, 2024
## [5.16.3](v5.16.2...v5.16.3) (2024-03-21)

### Bug Fixes

* **errors:** restore matching against all original errors ([#213](#213)) ([005fdb8](005fdb8))
@ibm-devx-sdk
Copy link

🎉 This PR is included in version 5.16.3 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants