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

feature(script): improve cancel() #602

Merged
merged 1 commit into from
Jul 18, 2015

Conversation

andreialecu
Copy link
Contributor

Allows passing an error object to cancel(err), or an exception object returned by the deployd internal-client (eg. {message: "", status: 400}).

This allows easy chaining such as (in an event script):

// call some other collection via internal-client
// both cases are handled by the new cancel, whether the code throws an Error object, or if .get returns an exception of the form {message, status}
dpd.somecol.get({...}).then(function() { error may get thrown here }.catch(cancel);

Allows passing an error object to `cancel(err)`, or an exception object returned by the deployd internal-client (eg. {message: "", status: 400}).

This allows easy chaining such as (in an event script):

```javascript
// call some other collection via internal-client
// both cases are handled by the new cancel, whether the code throws an Error object, or if .get returns an exception of the form {message, status}
dpd.somecol.get({...}).then(function() { error may get thrown here }.catch(cancel);
```
@andreialecu andreialecu force-pushed the feature-improvedcancel branch 2 times, most recently from 5bad106 to ea2bb01 Compare July 14, 2015 13:28
@ericfong ericfong merged commit ea2bb01 into deployd:master Jul 18, 2015
@ericfong
Copy link
Member

Thanks for your contribution!
Landed as ea2bb01

@andreialecu andreialecu deleted the feature-improvedcancel branch November 3, 2017 12:39
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

Successfully merging this pull request may close these issues.

2 participants