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

Some DB errors is not errors #41

Closed
wants to merge 8 commits into from

Conversation

kazhuravlev
Copy link
Contributor

get comment by id on non exists id or non exists bucket:
HTTP 400 + err => HTTP 404

get comments list on non exists page bucket, userID bucket:
HTTP 400 + err => HTTP 200 + blank comment list "[]"

@kazhuravlev kazhuravlev changed the title Handle db errors Some DB errors is not errors May 19, 2018
@kazhuravlev
Copy link
Contributor Author

one of tests is failed. but this test also failed on master branch (TestRemark_Export).
I fix this err in this PR

@kazhuravlev
Copy link
Contributor Author

@umputun please show me error cause.
on my side all tests, linter checks and docker-compose build is worked fine.

@umputun
Copy link
Owner

umputun commented May 19, 2018

until we switch to public CI (see #14) the only way to see what failed the build the same way as CI is to run docker build.

app/store/engine/bolt.go:217::warning: declaration of "err" shadows declaration at app/store/engine/bolt.go:210 (vetshadow)
28s
516
app/store/engine/bolt.go:488::warning: declaration of "err" shadows declaration at app/store/engine/bolt.go:477 (vetshadow)
28s
517
app/rest/api/rest.go:354:10:warning: if block ends with a return statement, so drop this else and outdent its block (golint)
28s
518

@umputun
Copy link
Owner

umputun commented May 19, 2018

I'm not sure what the purpose of this PR. What exactly the problem it's trying to solve by adding all this code? I mean, I get what it's trying to achieve is to differentiate store errors with more granularity, but don't get why all of this even needed in the first place.

Do you have any particular use-case in mind? To me, requests for non-exiting id, bucket, and the user feels like a good fit for "bad request".

@kazhuravlev
Copy link
Contributor Author

I do not speak English well. I hope you understand me:
I think that client must be simple as possible. Client can not process bad request errors. But client must work with comments API as with faceted search.

close until #14 ))

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.

None yet

2 participants