Skip to content

Commit

Permalink
added ignoreErrors option
Browse files Browse the repository at this point in the history
  • Loading branch information
juliangruber committed Aug 9, 2013
1 parent 27f2049 commit 664ab25
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -33,6 +33,7 @@ Create a readable stream that emits nearby places.
Possible options are:

* `timeout (Number)`: Give up finding the current position after x miliseconds
* `ignoreErrors (Boolean)`: If true, when a geolocation error happens, an empty position will be used.
* plus all the options from [places#createReadStream](https://github.com/Wayla/level-places#placescreatereadstream-latitude-longitude--options)
* plus all the options from [trie#createSearchStream](https://github.com/juliangruber/level-trie#triecreatesearchstreamstring-options)

Expand Down
3 changes: 2 additions & 1 deletion index.js
Expand Up @@ -8,7 +8,8 @@ function createNearbyStream (places, opts) {
var tmp = tmpStream();

getPosition(opts, function (err, pos) {
if (err) return tmp.emit('error', err);
if (err && !opts.ignoreErrors) return tmp.emit('error', err);
if (!pos) pos = {};

tmp.emit('position', pos);
var nearby = places.createReadStream(pos, opts);
Expand Down

0 comments on commit 664ab25

Please sign in to comment.