Skip to content

Conversation

@yury-s
Copy link
Member

@yury-s yury-s commented Jan 30, 2020

No description provided.

this._rawSend(messageObj);
return result;
} catch (e) {
return Promise.reject(e);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm trying to wrap my head around this. Previously _rawSend was throwing synchronously. Now we reject and return the rejection. How could something not handling the previous rejection start handling the new one?

Aside from my confusion about what this is doing, I think just marking send as async would do the same thing, without needing the try-catch.

Copy link
Member Author

@yury-s yury-s Jan 31, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously when the code threw exceptions synchronously it wouldn't be caught by send(...).catch(...) and would end up unhandled whereas now it's always wrapped in a promise.

Changed this to be async.

@yury-s yury-s force-pushed the convert-exception-to-promise branch from b5836cc to 301a73d Compare January 31, 2020 01:12
throw err;
}
return callFunctionOnPromise.then(response => {
}).then(response => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

await's will read better!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let me take care of that separately

@aslushnikov aslushnikov merged commit 985faeb into microsoft:master Jan 31, 2020
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.

3 participants