Skip to content

Conversation

@NathanWalker
Copy link
Contributor

PR Checklist

What is the current behavior?

Apps can error if url is invalid or response content is invalid.

What is the new behavior?

Error is properly caught and rejected to avoid Error: Uncaught (in promise) errors.

@ghost ghost added the ♥ community PR label Oct 24, 2018
@vakrilov
Copy link
Contributor

vakrilov commented Nov 2, 2018

Hi and thanks for the PR!

The team have been quite busy baking the upcoming NativeScript 5.0 release. We hope you love it as much as we do! The major release is the reason we taking longer with PR reviews. We will resume active reviewing in the following weeks.

Thanks for your patience and for being awesome contributor!

return new Promise<http.HttpResponse>((resolve, reject) => {

if (!options.url) {
reject('Request url was empty.');
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you reject with an error (reject(new Error('Request url was empty.'));) to be consistent with the other reject path.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good call 👍 Updated now.

Copy link
Contributor

@vakrilov vakrilov left a comment

Choose a reason for hiding this comment

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

Approve - once the comment is addressed.

@NathanWalker NathanWalker force-pushed the fix-uncaught-promise-on-image branch from b625cf0 to f7ee2bd Compare November 13, 2018 03:39
@ghost ghost assigned vakrilov Nov 13, 2018
@ghost ghost added in progress and removed ♥ community PR labels Nov 13, 2018
@vakrilov
Copy link
Contributor

test

@vakrilov vakrilov merged commit 950fdcf into NativeScript:master Nov 13, 2018
@ghost ghost removed the in progress label Nov 13, 2018
@lock
Copy link

lock bot commented Nov 13, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Nov 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants