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

fetch_type return value on notfound seems suboptimal #163

Closed
macintux opened this issue Apr 2, 2014 · 3 comments
Closed

fetch_type return value on notfound seems suboptimal #163

macintux opened this issue Apr 2, 2014 · 3 comments

Comments

@macintux
Copy link
Contributor

macintux commented Apr 2, 2014

I suspect this may be a holdover from pre-bucket-type days. Currently, if an object isn't found, the return value is {error, {notfound, <type>}}, whereas for normal K/V operations it's {error, notfound}.

Since fetch_type doesn't take a type for each request, and since each bucket type can only work with one data type, returning the type as part of the error code seems unnecessary (and means client code needs to watch for two different patterns).

@seancribbs
Copy link
Contributor

On the other hand, this would require the developer to fetch bucket properties, or know ahead of time and supply the expected type to modify_type. This was more about preventing unintentional errors and enabling the modify_type use-case. Honestly, if you're using datatypes this seems a minor inconvenience to match a slightly different pattern, given you're not working with riak objects anymore. Yes it's inconsistent, but it's a different API.

Would like more opinions on this.

@macintux
Copy link
Contributor Author

macintux commented Apr 2, 2014

If it has value, I'm definitely not strongly opposed to it, just wanted to make sure there was a reason for the behavior.

@macintux
Copy link
Contributor Author

Closing as etoolittleroi

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

2 participants