From 580b88144dbfa7df8760ff73df84197d78373710 Mon Sep 17 00:00:00 2001 From: Nishchal Gautam Date: Wed, 19 Oct 2016 16:40:09 -0700 Subject: [PATCH] `Promise.reject(String message)` depreciated Summary: Use a Error Code as first parameter instead since `Promise.reject(String message)` is depriciated Closes https://github.com/facebook/react-native/pull/10459 Differential Revision: D4048222 Pulled By: lacker fbshipit-source-id: 5676a459a1f1d21d0edcfb4385524eaad6b05954 --- docs/NativeModulesAndroid.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/NativeModulesAndroid.md b/docs/NativeModulesAndroid.md index a53f5a122..ec2aa50ad 100644 --- a/docs/NativeModulesAndroid.md +++ b/docs/NativeModulesAndroid.md @@ -216,7 +216,7 @@ Refactoring the above code to use a promise instead of callbacks looks like this public class UIManagerModule extends ReactContextBaseJavaModule { ... - + private static final String E_LAYOUT_ERROR = "E_LAYOUT_ERROR"; @ReactMethod public void measureLayout( int tag, @@ -234,7 +234,7 @@ public class UIManagerModule extends ReactContextBaseJavaModule { promise.resolve(map); } catch (IllegalViewOperationException e) { - promise.reject(e); + promise.reject(E_LAYOUT_ERROR, e); } }