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

Update exception reporting for future based methods #6

Closed
shamblett opened this issue Sep 4, 2014 · 1 comment
Closed

Update exception reporting for future based methods #6

shamblett opened this issue Sep 4, 2014 · 1 comment

Comments

@shamblett
Copy link
Owner

Methods that return a future and raise exceptions should raise the exception so as the callers future handler can catch it.

Sporran should be updated as follows -

Future put(....){
if (id == null) {
return new Future.error(new SporranException('put() expects a doc id.'));
}

this allows -

localSporran.put(....).then((jsonobject.JsonObject res) {
//do something
}, onError:(SporranException e){
//do something
});

Note, this update has been applied to the Wilt package, Sporran also needs general method parameter checking added to its methods.

@ghost ghost mentioned this issue Sep 6, 2014
@shamblett
Copy link
Owner Author

Changes incorporated, can be closed

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

1 participant