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

Return actual error types instead of generic + string #269

Open
drewmullen opened this issue Jan 16, 2024 · 0 comments
Open

Return actual error types instead of generic + string #269

drewmullen opened this issue Jan 16, 2024 · 0 comments

Comments

@drewmullen
Copy link

drewmullen commented Jan 16, 2024

idiomatic go suggests you should pass an specific error type instead of just a string. For example, if i query for a ticker position and dont have one, you should return ErrPositionNotExist, not a string.

example, return something like this: var ErrPositionNotExistForTicker = errors.New("position does not exist")

then i can check with error.Is()

@drewmullen drewmullen changed the title Documentation Request - What are the various codes that can be returned by GetPositions() Documentation Request - What are the various codes that can be returned by GetPosition() Jan 16, 2024
@drewmullen drewmullen changed the title Documentation Request - What are the various codes that can be returned by GetPosition() Return actual error types instead of generic + string Jan 16, 2024
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

No branches or pull requests

1 participant