-
Notifications
You must be signed in to change notification settings - Fork 245
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
What's the correct way to handle missing data? #46
Comments
Seems like calling Eg: osmosis
.get(url)
.find(...)
.set(...)
.follow(...)
.find(...)
.set(...)
.find(...) // This selector does not always resolve
.set(...})
.then(context, data, next) {
next(context, data);
}
.find(...)
.set(...)
.follow('a@href')
.find(...)
.set(..)
.data(function(stuff) {
...
})
.done(function() {
..
}) |
There isn't an official way to handle missing data. By default, Osmosis assumes that if one link in the chain fails, any subsequent commands will fail. This obviously isn't always the case. I'll be working on a solution to this. |
The next version of Osmosis is planned to have osmosis.get(url)
...
.do(
osmosis... ,
osmosis... ,
osmosis...
)
... |
Supported in 0.1.0 |
Whenever one of my find-commands fails and gives me "(find) no results for ____" Osmosis seems to abort the chain.
I tried catching the error with .error, but my subsequent find/data commands are still ignored.
What's the correct way to make Osmosis continue, ignoring the missing data?
I'm doing something like:
The text was updated successfully, but these errors were encountered: