-
- All Implemented Interfaces:
-
com.facebook.react.bridge.Promise
public class PromiseImpl implements Promise
-
-
Constructor Summary
Constructors Constructor Description PromiseImpl(Callback resolve, Callback reject)
-
Method Summary
Modifier and Type Method Description void
resolve(Object value)
Successfully resolve the Promise with an optional value. void
reject(String code, String message)
Report an error without an exception using a custom code and error message. void
reject(String code, Throwable throwable)
Report an exception with a custom code. void
reject(String code, String message, Throwable throwable)
Report an exception with a custom code and error message. void
reject(Throwable throwable)
Report an exception, with default error code. void
reject(Throwable throwable, WritableMap userInfo)
Report an exception, with default error code, with userInfo. void
reject(String code, @NonNull() WritableMap userInfo)
Reject with a code and userInfo WritableMap. void
reject(String code, Throwable throwable, WritableMap userInfo)
Report an exception with a custom code and userInfo. void
reject(String code, String message, @NonNull() WritableMap userInfo)
Report an error with a custom code, error message and userInfo, an error not caused by anexception. void
reject(@Nullable() String code, @Nullable() String message, @Nullable() Throwable throwable, @Nullable() WritableMap userInfo)
Report an exception with a custom code, error message and userInfo. void
reject(String message)
Report an error which wasn't caused by an exception. -
-
Method Detail
-
resolve
void resolve(Object value)
Successfully resolve the Promise with an optional value.
- Parameters:
value
- Object
-
reject
void reject(String code, String message)
Report an error without an exception using a custom code and error message.
- Parameters:
code
- Stringmessage
- String
-
reject
void reject(String code, Throwable throwable)
Report an exception with a custom code.
- Parameters:
code
- Stringthrowable
- Throwable
-
reject
void reject(String code, String message, Throwable throwable)
Report an exception with a custom code and error message.
- Parameters:
code
- Stringmessage
- Stringthrowable
- Throwable
-
reject
void reject(Throwable throwable)
Report an exception, with default error code. Useful in catch-all scenarios where it's unclearwhy the error occurred.
- Parameters:
throwable
- Throwable
-
reject
void reject(Throwable throwable, WritableMap userInfo)
Report an exception, with default error code, with userInfo. Useful in catch-all scenarioswhere it's unclear why the error occurred.
- Parameters:
throwable
- ThrowableuserInfo
- WritableMap
-
reject
void reject(String code, @NonNull() WritableMap userInfo)
Reject with a code and userInfo WritableMap.
- Parameters:
code
- StringuserInfo
- WritableMap
-
reject
void reject(String code, Throwable throwable, WritableMap userInfo)
Report an exception with a custom code and userInfo.
- Parameters:
code
- Stringthrowable
- ThrowableuserInfo
- WritableMap
-
reject
void reject(String code, String message, @NonNull() WritableMap userInfo)
Report an error with a custom code, error message and userInfo, an error not caused by anexception.
- Parameters:
code
- Stringmessage
- StringuserInfo
- WritableMap
-
reject
void reject(@Nullable() String code, @Nullable() String message, @Nullable() Throwable throwable, @Nullable() WritableMap userInfo)
Report an exception with a custom code, error message and userInfo.
- Parameters:
code
- Stringmessage
- Stringthrowable
- ThrowableuserInfo
- WritableMap
-
reject
@Deprecated() void reject(String message)
Report an error which wasn't caused by an exception.
-
-
-
-