`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
This commit is contained in:
Nishchal Gautam 2016-10-19 16:40:09 -07:00 committed by Facebook Github Bot
parent f6e5bf5263
commit 580b88144d
1 changed files with 2 additions and 2 deletions

View File

@ -216,7 +216,7 @@ Refactoring the above code to use a promise instead of callbacks looks like this
public class UIManagerModule extends ReactContextBaseJavaModule { public class UIManagerModule extends ReactContextBaseJavaModule {
... ...
private static final String E_LAYOUT_ERROR = "E_LAYOUT_ERROR";
@ReactMethod @ReactMethod
public void measureLayout( public void measureLayout(
int tag, int tag,
@ -234,7 +234,7 @@ public class UIManagerModule extends ReactContextBaseJavaModule {
promise.resolve(map); promise.resolve(map);
} catch (IllegalViewOperationException e) { } catch (IllegalViewOperationException e) {
promise.reject(e); promise.reject(E_LAYOUT_ERROR, e);
} }
} }