<commit_before>package net.hawkengine.ws;

import net.hawkengine.model.ServiceResult;
import net.hawkengine.model.User;
import net.hawkengine.model.dto.WsContractDto;

public class EndpointConnector {
    public static void passResultToEndpoint(String className, String methodName, ServiceResult serviceResult) {
        WsContractDto contract = new WsContractDto();
        contract.setClassName(className);
        contract.setMethodName(methodName);
        contract.setResult(serviceResult.getObject());
        contract.setError(serviceResult.hasError());
        contract.setErrorMessage(serviceResult.getMessage());

        SessionPool.getInstance().sendToAuthorizedSessions(contract);
    }

    public static void passResultToEndpoint(String className, String methodName, ServiceResult serviceResult, User user) {
        WsContractDto contract = new WsContractDto();
        contract.setClassName(className);
        contract.setMethodName(methodName);
        contract.setResult(serviceResult.getObject());
        contract.setError(serviceResult.hasError());
        contract.setErrorMessage(serviceResult.getMessage());

        SessionPool.getInstance().sendToUserSessions(contract, user);
    }
}<commit_msg>refactor error property with enum in EndpointConnector #213<commit_after>package net.hawkengine.ws;

import net.hawkengine.model.ServiceResult;
import net.hawkengine.model.User;
import net.hawkengine.model.dto.WsContractDto;

public class EndpointConnector {
    public static void passResultToEndpoint(String className, String methodName, ServiceResult serviceResult) {
        WsContractDto contract = new WsContractDto();
        contract.setClassName(className);
        contract.setMethodName(methodName);
        contract.setResult(serviceResult.getObject());
        contract.setNotificationType(serviceResult.getNotificationType());
        contract.setErrorMessage(serviceResult.getMessage());

        SessionPool.getInstance().sendToAuthorizedSessions(contract);
    }

    public static void passResultToEndpoint(String className, String methodName, ServiceResult serviceResult, User user) {
        WsContractDto contract = new WsContractDto();
        contract.setClassName(className);
        contract.setMethodName(methodName);
        contract.setResult(serviceResult.getObject());
        contract.setNotificationType(serviceResult.getNotificationType());
        contract.setErrorMessage(serviceResult.getMessage());

        SessionPool.getInstance().sendToUserSessions(contract, user);
    }
}
{'fraction_non_alphanumeric': 0.09101654846335698, 'fraction_numerical': 0.001182033096926714, 'mean_word_length': 4.567982456140351, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4152200', 'n_tokens_mistral': 634, 'n_tokens_neox': 635, 'n_words': 111}