-
- 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 voidresolve(Object value)Successfully resolve the Promise with an optional value. voidreject(String code, String message)Report an error without an exception using a custom code and error message. voidreject(String code, Throwable throwable)Report an exception with a custom code. voidreject(String code, String message, Throwable throwable)Report an exception with a custom code and error message. voidreject(Throwable throwable)Report an exception, with default error code. voidreject(Throwable throwable, WritableMap userInfo)Report an exception, with default error code, with userInfo. voidreject(String code, @NonNull() WritableMap userInfo)Reject with a code and userInfo WritableMap. voidreject(String code, Throwable throwable, WritableMap userInfo)Report an exception with a custom code and userInfo. voidreject(String code, String message, @NonNull() WritableMap userInfo)Report an error with a custom code, error message and userInfo, an error not caused by anexception. voidreject(@Nullable() String code, @Nullable() String message, @Nullable() Throwable throwable, @Nullable() WritableMap userInfo)Report an exception with a custom code, error message and userInfo. voidreject(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.
-
-
-
-