private boolean isFatalError(Reply reply) {
        Error error = reply.getError(0);
        return switch (error.getCode()) {
            case ErrorCode.TIMEOUT, DocumentProtocol.ERROR_BUCKET_NOT_FOUND,
                 DocumentProtocol.ERROR_WRONG_DISTRIBUTION -> false;
            default -> error.isFatal();
        };
    }
NOTE: not called from within lock, function must take lock itself
documentapi/src/main/java/com/yahoo/documentapi/messagebus/MessageBusVisitorSession.java