-
public interface Promise
-
-
Method Summary
Modifier and Type Method Description abstract void
resolve(@Nullable() Object value)
Successfully resolve the Promise with an optional value. abstract void
reject(String code, String message)
Report an error without an exception using a custom code and error message. abstract void
reject(String code, Throwable throwable)
Report an exception with a custom code. abstract void
reject(String code, String message, Throwable throwable)
Report an exception with a custom code and error message. abstract void
reject(Throwable throwable)
Report an exception, with default error code. abstract void
reject(Throwable throwable, WritableMap userInfo)
Report an exception, with default error code, with userInfo. abstract void
reject(String code, @NonNull() WritableMap userInfo)
Reject with a code and userInfo WritableMap. abstract void
reject(String code, Throwable throwable, WritableMap userInfo)
Report an exception with a custom code and userInfo. abstract 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. abstract void
reject(String code, String message, Throwable throwable, WritableMap userInfo)
Report an exception with a custom code, error message and userInfo. abstract void
reject(String message)
Report an error which wasn't caused by an exception. -
-
Method Detail
-
resolve
abstract void resolve(@Nullable() Object value)
Successfully resolve the Promise with an optional value.
- Parameters:
value
- Object
-
reject
abstract void reject(String code, String message)
Report an error without an exception using a custom code and error message.
- Parameters:
code
- Stringmessage
- String
-
reject
abstract void reject(String code, Throwable throwable)
Report an exception with a custom code.
- Parameters:
code
- Stringthrowable
- Throwable
-
reject
abstract void reject(String code, String message, Throwable throwable)
Report an exception with a custom code and error message.
- Parameters:
code
- Stringmessage
- Stringthrowable
- Throwable
-
reject
abstract 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
abstract 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
abstract void reject(String code, @NonNull() WritableMap userInfo)
Reject with a code and userInfo WritableMap.
- Parameters:
code
- StringuserInfo
- WritableMap
-
reject
abstract void reject(String code, Throwable throwable, WritableMap userInfo)
Report an exception with a custom code and userInfo.
- Parameters:
code
- Stringthrowable
- ThrowableuserInfo
- WritableMap
-
reject
abstract 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
abstract void reject(String code, String message, Throwable throwable, WritableMap userInfo)
Report an exception with a custom code, error message and userInfo.
- Parameters:
code
- Stringmessage
- Stringthrowable
- ThrowableuserInfo
- WritableMap
-
reject
@Deprecated() abstract void reject(String message)
Report an error which wasn't caused by an exception.
-
-
-
-