`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:
parent
f6e5bf5263
commit
580b88144d
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue