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

feat: add errorz package to combine errors as enum in there #47

Conversation

nedimakar
Copy link

I just created an errorz package that will contain errors enum so we can use them multiple time and change them in one place.

I was thinking about adding couple of helper functions but I don't know that much the requirements of project. But place is ready to write sth.

@nedimakar nedimakar self-assigned this Oct 17, 2023
@nedimakar nedimakar requested a review from bmo-at-a9s October 17, 2023 13:00
@nedimakar nedimakar requested a review from bmo-at-a9s October 18, 2023 12:21
@bmo-at-a9s bmo-at-a9s requested a review from mafolz October 23, 2023 06:22
Copy link

@bmo-at-a9s bmo-at-a9s left a comment

Choose a reason for hiding this comment

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

I added a branch with some suggestions, you can have a look at them here 8c42502
and incorparate them in your code as you see fit.
As discussed with MF on friday, I used a sligtly more discriptive module name and would suggest you do the same here.
If you have questions, I am available

src/jetstream/datastore/datastore.go Outdated Show resolved Hide resolved
src/jetstream/errorz/errorz.go Outdated Show resolved Hide resolved
src/jetstream/errorz/errorz.go Outdated Show resolved Hide resolved
@nedimakar
Copy link
Author

@bmo-at-a9s I check you suggestions and I think your suggestion totally makes sense to me so no objection. I guess we can merge your changes into this branch.

@nedimakar
Copy link
Author

nedimakar commented Oct 31, 2023

I added a branch with some suggestions, you can have a look at them here 8c42502 and incorparate them in your code as you see fit. As discussed with MF on friday, I used a sligtly more discriptive module name and would suggest you do the same here. If you have questions, I am available

I test your suggestions but are you sure that this changes pass tests?

Expected: (*errors.errorString){s:"Error trying to get current database version: error"}
Actual:   (*fmt.wrapError){msg:"pgsql_goosedb: error trying to get current database version: error", err:(*errors.errorString){s:"error"}}
  (Should equal)!

@nedimakar nedimakar removed their assignment Oct 31, 2023
@bmo-at-a9s
Copy link

I added a branch with some suggestions, you can have a look at them here 8c42502 and incorparate them in your code as you see fit. As discussed with MF on friday, I used a sligtly more discriptive module name and would suggest you do the same here. If you have questions, I am available

I test your suggestions but are you sure that this changes pass tests?

Expected: (*errors.errorString){s:"Error trying to get current database version: error"}
Actual:   (*fmt.wrapError){msg:"pgsql_goosedb: error trying to get current database version: error", err:(*errors.errorString){s:"error"}}
  (Should equal)!

Yeah, the test case needed to be adjusted for this to work with our new dynamic helper error.
I fixed it real quick, other than that it looks good to me! Thank you for this

@nedimakar nedimakar merged commit 61e3c00 into develop Nov 2, 2023
2 checks passed
@nedimakar nedimakar deleted the feature/INT-3389-stratos-jetstream-change-error-handling-from-string-comparisons-to-idiomatic-error-checking branch November 2, 2023 14:45
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