mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-03 07:14:59 +08:00
Standardize Error objects for Promises
Summary:
public
Promises are coming. And as part of it, we are standardizing the error objects that will be returned. This puts the code in place on the Android side to always send the proper error format.
It will be an error object like this
`{
code : "E_SOME_ERROR_CODE_DEFINED_BY_MODULE", // Meant to be machine parseable
message : "Human readable message",
nativeError : {} // Some representation of the underlying error (Exception or NSError) , still figuring out exactly, but hopefully something with stack info
}`
Reviewed By: davidaurelio
Differential Revision: D2839927
fb-gh-sync-id: 08f1ce79af24d70357b9957f14471a12627dcffa
This commit is contained in:
committed by
facebook-github-bot-7
parent
c8355d377f
commit
a10b4d8c47
@@ -19,5 +19,8 @@ package com.facebook.react.bridge;
|
||||
public interface Promise {
|
||||
void resolve(Object value);
|
||||
void reject(Throwable reason);
|
||||
@Deprecated
|
||||
void reject(String reason);
|
||||
void reject(String code, Throwable extra);
|
||||
void reject(String code, String reason, Throwable extra);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user