reject

abstract fun reject(code: String, message: String?)

Report an error without an exception using a custom code and error message.

Parameters

code

String

message

String


abstract fun reject(code: String, throwable: Throwable?)

Report an exception with a custom code.

Parameters

code

String

throwable

Throwable


abstract fun reject(code: String, message: String?, throwable: Throwable?)

Report an exception with a custom code and error message.

Parameters

code

String

message

String

throwable

Throwable


abstract fun reject(throwable: Throwable)

Report an exception, with default error code. Useful in catch-all scenarios where it's unclear why the error occurred.

Parameters

throwable

Throwable


abstract fun reject(throwable: Throwable, userInfo: WritableMap)

Report an exception, with default error code, with userInfo. Useful in catch-all scenarios where it's unclear why the error occurred.

Parameters

throwable

Throwable

userInfo

WritableMap


abstract fun reject(code: String, userInfo: WritableMap)

Reject with a code and userInfo WritableMap.

Parameters

code

String

userInfo

WritableMap


abstract fun reject(code: String, throwable: Throwable?, userInfo: WritableMap)

Report an exception with a custom code and userInfo.

Parameters

code

String

throwable

Throwable

userInfo

WritableMap


abstract fun reject(code: String, message: String?, userInfo: WritableMap)

Report an error with a custom code, error message and userInfo, an error not caused by an exception.

Parameters

code

String

message

String

userInfo

WritableMap


abstract fun reject(code: String?, message: String?, throwable: Throwable?, userInfo: WritableMap?)

Report an exception with a custom code, error message and userInfo.

Parameters

code

String

message

String

throwable

Throwable

userInfo

WritableMap


abstract fun reject(message: String)

Deprecated

Prefer passing a module-specific error code to JS. Using this method will pass the error code EUNSPECIFIED

Replace with

reject(code, message)

Report an error which wasn't caused by an exception.