exceptionOrNull

Returns the exception if this is a Failure, or null if this is a Success.

Use this method to safely access the error without pattern matching.

result.exceptionOrNull()?.let { error ->
Log.e("BLE", "Error: ${error.message}, GATT: ${error.gattStatus}")
}

Return

The BleException if this is a failure, or null if this is a success.