Skip to main content

IsCausedBy

Gets whether error is caused by another error with errCode.

def IsCausedBy(
e: error,
errCode: ErrorCode
) - > bool

Gets whether error is caused by another error with errCode.

Parameters​

NameTypeDescription
eerrorThe error to check, which may be a wrapped error containing a chain of underlying causes.
errCodeErrorCodeThe specific error code to search for within the error chain.

Returns​

TypeDescription
boolTrue if the error chain contains an error with the specified error code, False otherwise.