mongodb / go-client-mongodb-atlas

Go Client for MongoDB Atlas
https://www.mongodb.com/docs/atlas/reference/api-resources-spec/
Apache License 2.0
79 stars 34 forks source link

Add error handling for SDK #456

Closed wtrocki closed 1 year ago

wtrocki commented 1 year ago

Description

Add error handling for the sdk with documentation

wtrocki commented 1 year ago

some small style comments and a question, is the goal to use sdk for the util functions?

Yes. I struggled with naming so if you have any proposition let me know. We need place to put some non generated code like errors, pagination helpers etc.

CC @andmatei :godmode:

gssbzn commented 1 year ago

I struggled with naming so if you have any proposition let me know.

Up to me a package errors for these methods, a package pagination for pagination and so on to follow a good practice of meaningful names instead of generic utils packages

wtrocki commented 1 year ago

My worry is that without pkg folder we going to end up with a lot of folders containing 1-2 go files vs single client folder containing +500 that is hard to find. If we introduce pkg then mongodbatlasv2 would not be appropriate. Introducing some subfolder of the generated code will complicate sdk cleanup.

If possible will look to improve this for GA (were we going to get a separate repository so layout can change). Idea might be to add both SDK and rest of the files to pkg folder.

wtrocki commented 1 year ago

Will merge but if you have any opinion I'm happy to fix this in follow up PR.