react-native/ReactAndroid
Rene Weber c6614f117f Add explicit error message if e.getMessage is null
Summary:
In the NetworkingModule, if the http request failed, we send a `didCompleteNetworkResponse` event with the error message, which is used on JS side to determine if the request was erroring. Currently we get the error message from `e.getMessage()`, however, not all exceptions have a message and it might therefore return null and thus resulting in no error on JS side. This change checks if the message is null and if so uses a default message.

In android send a request using XMLHttpRequest with a timeout set to a server that has a delay larger than the timeout (so we force the timeout to happen).

```
const request =  new XMLHttpRequest();
request.open('GET', "http://localhost:3000/", true);
request.timeout = 1000;
request.ontimeout = () => { console.log('ontimeout'); };
request.send();
```

See the timeout callback being called correctly.

Fixes #11666
Closes https://github.com/facebook/react-native/pull/13407

Differential Revision: D4963764

Pulled By: hramos

fbshipit-source-id: 61ffcef9e0594fe9bface24fdb8bde1e6eec3990
2017-04-27 12:15:48 -07:00
..
libs Apply auto-formatter for BUCK files in fbandroid. 2017-02-27 14:04:56 -08:00
src Add explicit error message if e.getMessage is null 2017-04-27 12:15:48 -07:00
.npmignore
DEFS Fix ReactNative build break 2017-03-14 13:16:11 -07:00
DevExperience.md
README.md
build.gradle Use tag ids for testID 2017-04-05 12:39:29 -07:00
gradle.properties
release.gradle

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.