appbaseio / appbase-js

appbase.io search client library for JavaScript
MIT License
42 stars 18 forks source link

getStream() throws an error "method does not support streaming." when a document does not exist #7

Closed siddharthlatest closed 2 years ago

siddharthlatest commented 8 years ago

A document with a non-existent id throws the following error:

Since get() on a non-existent document returns a JSON object with a field "found" set to false, getStream() should a response message to the effect:

"document with type :type and id :id cannot be found."

siddharthlatest commented 8 years ago

This is interesting as searchStream() does not return an error when the :type does not exist.

sacheendra commented 8 years ago

This is because, when there is no document the GET returns a 404. Therefore, it is saying that GET /doc_that_does_not_exist is a method that does not support streaming.

siddharthlatest commented 8 years ago

It should return an error, that's correct. But an appropriate message would be "document with type :type and id :id cannot be found." over "This method does not support streaming".