code: public static int _err2status(ForestException ex) {
          if (ex == null || ex.code == 0)
              return Status.OK;
  
          Log.d(TAG, "[_err2status()] ForestException: domain=%d, code=%d", ex, ex.domain, ex.code);
  
          switch (ex.domain) {
              case C4ErrorDomain.HTTPDomain:
                  return ex.code;
              case C4ErrorDomain.POSIXDomain:
                  break;
              case C4ErrorDomain.ForestDBDomain:
                  switch (ex.code) {
                      case FDBErrors.FDB_RESULT_SUCCESS:
                          return Status.OK;
                      case FDBErrors.FDB_RESULT_KEY_NOT_FOUND:
                      case FDBErrors.FDB_RESULT_NO_SUCH_FILE:
                          return Status.NOT_FOUND;
                      case FDBErrors.FDB_RESULT_RONLY_VIOLATION:
                          return Status.FORBIDDEN;
                      case FDBErrors.FDB_RESULT_NO_DB_HEADERS:
                      case FDBErrors.FDB_RESULT_CRYPTO_ERROR:
                          return Status.UNAUTHORIZED;
                      case FDBErrors.FDB_RESULT_CHECKSUM_ERROR:
                      case FDBErrors.FDB_RESULT_FILE_CORRUPTION:
                          return Status.CORRUPT_ERROR;
                  }
                  break;
              case C4ErrorDomain.C4Domain:
                  switch (ex.code) {
                      case C4DomainErrorCode.kC4ErrorCorruptRevisionData:
                      case C4DomainErrorCode.kC4ErrorCorruptIndexData:
                          return Status.CORRUPT_ERROR;
                      case C4DomainErrorCode.kC4ErrorBadRevisionID:
                          return Status.BAD_ID;
                      case C4DomainErrorCode.kC4ErrorAssertionFailed:
                          break;
                      default:
                          break;
                  }
                  break;
          }
          return Status.DB_ERROR;
      }
docs: in CBLForestBridge.m
  CBLStatus err2status(C4Error c4err)