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

How to report errors after streaming has started? #341

Open
jblashka opened this issue Sep 20, 2017 · 3 comments
Open

How to report errors after streaming has started? #341

jblashka opened this issue Sep 20, 2017 · 3 comments

Comments

@jblashka
Copy link
Contributor

I ran into lightblue-platform/lightblue-mongo#381 earlier, which caused my stream to return no results. But the client didn't throw an exception or indicate to me in any way that there was an error the occurred while processing the results. All I saw was that my streaming query resulted in no documents returned, but when I stepped through the query execution with a debugger I saw that the returned JSON contained:

...errors":[{"objectType":"error","context":"rest/FindCommand/containerImageRPMManifest/findAndStream(containerImageRPMManifest:1.0.0-SNAPSHOT)/mongo:find","errorCode":"mongo-crud:TooManyResults","msg":"17581"}]}

If I wasn't actively watching the results from my query and I wasn't aware that this query should have had results, I wouldn't have known there was a problem. Without setting some error flag or throwing some exception I'm concerned that some error while streaming results could occur and it would be silently consumed by lightblue and there'd be no way to report that an error occurred.

@jblashka
Copy link
Contributor Author

jblashka commented Sep 29, 2017

Adding onto this. No exceptions get thrown if I query an unknown version of metadata either.

@paterczm
Copy link
Contributor

paterczm commented Oct 2, 2017

@jblashka, can't reproduce your example with unknown version.

/rest/data/find/entity/#.#.#?stream=true returns

"errors": [
        {
            "objectType": "error",
            "context": "rest/FindCommand/entity/findAndStream(entity:#.#.#)/getEntityMetadata(entity:#.#.#)",
            "errorCode": "mongo-metadata:UnknownVersion",
            "msg": "entity:#.#.#"
        }

@paterczm
Copy link
Contributor

paterczm commented Oct 5, 2017

Realized that the response above does not have status set, probably this is why lightblue-client is confused. Merging lightblue-platform/lightblue-core#814 should solve the issue.

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