HomeException

class HomeException : Exception


The exception thrown if any issue is encountered during an API call. Exceptions could be recoverable by the user of the API or unrecoverable. The error code in each exception needs to be documented to showcase the state.

Summary

Nested types

Public companion functions

HomeException
aborted(message: String, exception: Exception?, vararg subErrors: HomeError)
HomeException
alreadyExists(
    message: String,
    exception: Exception?,
    vararg subErrors: HomeError
)
HomeException
apiNotConnected(
    message: String,
    exception: Exception?,
    vararg subErrors: HomeError
)
HomeException
bulkError(subErrors: Map<StringHomeError>)

This function is deprecated. Use writeFailed or commandFailed methods instead.

HomeException
cancelled(
    message: String,
    exception: Exception?,
    vararg subErrors: HomeError
)
HomeException
HomeException
cursorWindowNotSupported(
    message: String,
    exception: Exception?,
    vararg subErrors: HomeError
)
HomeException
dataHolderColumnEmpty(
    message: String,
    exception: Exception?,
    vararg subErrors: HomeError
)
HomeException
dataHolderColumnNotFound(
    message: String,
    exception: Exception?,
    vararg subErrors: HomeError
)
HomeException
dataHolderColumnNull(
    message: String,
    exception: Exception?,
    vararg subErrors: HomeError
)
HomeException
dataLoss(message: String, exception: Exception?, vararg subErrors: HomeError)
HomeException
deadlineExceeded(
    message: String,
    exception: Exception?,
    vararg subErrors: HomeError
)
HomeException
failedPrecondition(
    message: String,
    exception: Exception?,
    vararg subErrors: HomeError
)
HomeException
internal(message: String, exception: Exception?, vararg subErrors: HomeError)
HomeException
invalidArgument(
    message: String,
    exception: Exception?,
    vararg subErrors: HomeError
)
HomeException
invalidDataHolder(
    message: String,
    exception: Exception?,
    vararg subErrors: HomeError
)
HomeException
notFound(message: String, exception: Exception?, vararg subErrors: HomeError)
HomeException
outOfRange(
    message: String,
    exception: Exception?,
    vararg subErrors: HomeError
)
HomeException
permissionDenied(
    message: String,
    exception: Exception?,
    vararg subErrors: HomeError
)
HomeException
resourceExhausted(
    message: String,
    exception: Exception?,
    vararg subErrors: HomeError
)
HomeException
sdkInitializationMissingInfo(
    message: String,
    exception: Exception?,
    vararg subErrors: HomeError
)
HomeException
unauthenticated(
    message: String,
    exception: Exception?,
    vararg subErrors: HomeError
)
HomeException
unavailable(
    message: String,
    exception: Exception?,
    vararg subErrors: HomeError
)
HomeException
unimplemented(
    message: String,
    exception: Exception?,
    vararg subErrors: HomeError
)
HomeException
unknown(message: String, exception: Exception?, vararg subErrors: HomeError)
HomeException

Public constructors

HomeException(
    error: HomeError,
    exception: Exception?,
    subErrors: Map<StringHomeError>
)

This function is deprecated. Use companion methods instead.

HomeException(
    code: Int,
    message: String,
    exception: Exception?,
    subErrors: Map<StringHomeError>
)

This function is deprecated. Use companion methods instead.

Public functions

List<Int>

Returns the error codes of the sub errors.

HomeException

Returns the first sub error if the error is a command or write error.

Public properties

HomeError

the home error that occurred

Map<StringHomeError>

any errors that were from sub operations, usually only set for bulk operations

Inherited properties

From kotlin.Throwable

Public companion functions

aborted

fun aborted(
    message: String = "",
    exception: Exception? = null,
    vararg subErrors: HomeError = emptyArray()
): HomeException

alreadyExists

fun alreadyExists(
    message: String = "",
    exception: Exception? = null,
    vararg subErrors: HomeError = emptyArray()
): HomeException

apiNotConnected

fun apiNotConnected(
    message: String = "",
    exception: Exception? = null,
    vararg subErrors: HomeError = emptyArray()
): HomeException

bulkError

fun bulkError(subErrors: Map<StringHomeError>): HomeException

Used to inform callers of specific failures during a bulk operation

cancelled

fun cancelled(
    message: String = "",
    exception: Exception? = null,
    vararg subErrors: HomeError = emptyArray()
): HomeException

commandFailed

fun commandFailed(subErrors: Map<StringHomeError>): HomeException

cursorWindowNotSupported

fun cursorWindowNotSupported(
    message: String = "",
    exception: Exception? = null,
    vararg subErrors: HomeError = emptyArray()
): HomeException

dataHolderColumnEmpty

fun dataHolderColumnEmpty(
    message: String = "",
    exception: Exception? = null,
    vararg subErrors: HomeError = emptyArray()
): HomeException

dataHolderColumnNotFound

fun dataHolderColumnNotFound(
    message: String = "",
    exception: Exception? = null,
    vararg subErrors: HomeError = emptyArray()
): HomeException

dataHolderColumnNull

fun dataHolderColumnNull(
    message: String = "",
    exception: Exception? = null,
    vararg subErrors: HomeError = emptyArray()
): HomeException

dataLoss

fun dataLoss(
    message: String = "",
    exception: Exception? = null,
    vararg subErrors: HomeError = emptyArray()
): HomeException

deadlineExceeded

fun deadlineExceeded(
    message: String = "",
    exception: Exception? = null,
    vararg subErrors: HomeError = emptyArray()
): HomeException

failedPrecondition

fun failedPrecondition(
    message: String = "",
    exception: Exception? = null,
    vararg subErrors: HomeError = emptyArray()
): HomeException

internal

fun internal(
    message: String = "",
    exception: Exception? = null,
    vararg subErrors: HomeError = emptyArray()
): HomeException

invalidArgument

fun invalidArgument(
    message: String = "",
    exception: Exception? = null,
    vararg subErrors: HomeError = emptyArray()
): HomeException

invalidDataHolder

fun invalidDataHolder(
    message: String = "",
    exception: Exception? = null,
    vararg subErrors: HomeError = emptyArray()
): HomeException

notFound

fun notFound(
    message: String = "",
    exception: Exception? = null,
    vararg subErrors: HomeError = emptyArray()
): HomeException

outOfRange

fun outOfRange(
    message: String = "",
    exception: Exception? = null,
    vararg subErrors: HomeError = emptyArray()
): HomeException

permissionDenied

fun permissionDenied(
    message: String = "",
    exception: Exception? = null,
    vararg subErrors: HomeError = emptyArray()
): HomeException

resourceExhausted

fun resourceExhausted(
    message: String = "",
    exception: Exception? = null,
    vararg subErrors: HomeError = emptyArray()
): HomeException

sdkInitializationMissingInfo

fun sdkInitializationMissingInfo(
    message: String = "",
    exception: Exception? = null,
    vararg subErrors: HomeError = emptyArray()
): HomeException

unauthenticated

fun unauthenticated(
    message: String = "",
    exception: Exception? = null,
    vararg subErrors: HomeError = emptyArray()
): HomeException

unavailable

fun unavailable(
    message: String = "",
    exception: Exception? = null,
    vararg subErrors: HomeError = emptyArray()
): HomeException

unimplemented

fun unimplemented(
    message: String = "",
    exception: Exception? = null,
    vararg subErrors: HomeError = emptyArray()
): HomeException

unknown

fun unknown(
    message: String = "",
    exception: Exception? = null,
    vararg subErrors: HomeError = emptyArray()
): HomeException

writeFailed

fun writeFailed(subErrors: Map<StringHomeError>): HomeException

Public constructors

HomeException

HomeException(
    error: HomeError,
    exception: Exception? = null,
    subErrors: Map<StringHomeError> = emptyMap()
)
Parameters
error: HomeError

the home error that occurred

exception: Exception? = null

another exception that caused this one

subErrors: Map<StringHomeError> = emptyMap()

any errors that were from sub operations, usually only set for bulk operations

HomeException

HomeException(
    code: Int,
    message: String,
    exception: Exception? = null,
    subErrors: Map<StringHomeError> = emptyMap()
)

Public functions

getSubErrorCodes

fun getSubErrorCodes(): List<Int>

Returns the error codes of the sub errors. The error codes are returned in the format of * 100 + . For example, if the parent error code is 13 (INTERNAL) and the sub error code is 5 (STRUCTURE_FLOW_FAILED), the returned value will be 1305.

unwrap

fun unwrap(): HomeException

Returns the first sub error if the error is a command or write error. Otherwise, returns the current exception.

Public properties

error

val errorHomeError

the home error that occurred

subErrors

val subErrorsMap<StringHomeError>

any errors that were from sub operations, usually only set for bulk operations