react-native/ReactAndroid
Jamie Curtis da84eba318 Catch exception and report it when making a network request with invalid URL on Android
Summary:
Currently if you invoke `fetch()` with an invalid URL ("aaa" for
example) you cannot catch the error in javascript since it's not
reported. Instead the entire app crashes.

Fixes #7436 and #18087

Hopefully.

<!--
Thank you for sending the PR! We appreciate you spending the time to work on these changes.

Help us understand your motivation by explaining why you decided to make this change.

You can learn more about contributing to React Native here: http://facebook.github.io/react-native/docs/contributing.html

Happy contributing!

-->

Fix using fetch on Android with user generated input.

Added relevant unit test

`./scripts/run-android-local-unit-tests.sh` all pass

[ANDROID] [BUGFIX] [fetch] - Allow "unexpected url" exception to be caught on Android when using fetch
<!--
Help reviewers and the release process by writing your own release notes

**INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.**

  CATEGORY
[----------]        TYPE
[ CLI      ]   [-------------]      LOCATION
[ DOCS     ]   [ BREAKING    ]   [-------------]
[ GENERAL  ]   [ BUGFIX      ]   [-{Component}-]
[ INTERNAL ]   [ ENHANCEMENT ]   [ {File}      ]
[ IOS      ]   [ FEATURE     ]   [ {Directory} ]   |-----------|
[ ANDROID  ]   [ MINOR       ]   [ {Framework} ] - | {Message} |
[----------]   [-------------]   [-------------]   |-----------|

[CATEGORY] [TYPE] [LOCATION] - MESSAGE

 EXAMPLES:

 [IOS] [BREAKING] [FlatList] - Change a thing that breaks other things
 [ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput
 [CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with
 [DOCS] [BUGFIX] [GettingStarted.md] - Accidentally a thing/word
 [GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position
 [INTERNAL] [FEATURE] [./scripts] - Added thing to script that nobody will see
-->
Closes https://github.com/facebook/react-native/pull/18103

Differential Revision: D7097110

Pulled By: hramos

fbshipit-source-id: 69144e8a0f7404d9bcc7c71a94650de36a48c84a
2018-02-27 04:39:01 -08:00
..
libs Make xplat react native files buildable 2018-01-21 22:05:05 -08:00
src Catch exception and report it when making a network request with invalid URL on Android 2018-02-27 04:39:01 -08:00
.npmignore Don't publish /ReactAndroid/build to npm, update version on master 2015-10-12 11:11:40 -07:00
DevExperience.md CHORE - Remove Trailing Spaces 2016-04-06 09:21:53 -07:00
README.md Add scripts for running tests locally 2016-05-04 08:58:18 -07:00
build.gradle Extend Navigation to support "is_fabric" param from native 2018-02-13 13:50:22 -08:00
gradle.properties fixed mockito version 2016-10-04 10:43:35 -07:00
release.gradle Update ReactAndroid build script to support gradle 2.3.0 2018-02-23 19:16:02 -08:00

README.md

Building React Native for Android

See the docs on the website.

Running tests

When you submit a pull request CircleCI will automatically run all tests. To run tests locally, see Testing.