Skip to content

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
Contributor

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