<commit_before>package com.scangarella.pipe.stereotype;

import akka.actor.UntypedActor;
import com.scangarella.pipe.transmission.ErrorMessage;

/**
 * An error handler is used to process error messages.
 */
public abstract class ErrorHandler extends UntypedActor{
    /**
     * Receives a message from a pipe and processes the message.
     * @param message The received message.
     */
    @Override
    @SuppressWarnings("unchecked")
    public final void onReceive(Object message) {
        onError((ErrorMessage) message);
    }

    /**
     * Process the received error message
     * @param message The message to process.
     */
    public abstract void onError(ErrorMessage message);
}<commit_msg>Init error handler<commit_after>package com.scangarella.pipe.stereotype;

import akka.actor.UntypedActor;
import com.scangarella.pipe.transmission.ErrorMessage;
import com.scangarella.pipe.transmission.InitializationMessage;

/**
 * An error handler is used to process error messages.
 */
public abstract class ErrorHandler extends UntypedActor{
    /**
     * Receives a message from a pipe and processes the message.
     * @param message The received message.
     */
    @Override
    @SuppressWarnings("unchecked")
    public final void onReceive(Object message) {
        if (message != null) {
            if (message instanceof InitializationMessage) {
                initializePipe((InitializationMessage) message);
            } else {
                onError((ErrorMessage) message);
            }
        }
    }

    private void initializePipe(InitializationMessage message) {

    }

    /**
     * Process the received error message
     * @param message The message to process.
     */
    public abstract void onError(ErrorMessage message);
}
{'fraction_non_alphanumeric': 0.08356860530773574, 'fraction_numerical': 0.0, 'mean_word_length': 2.9730941704035874, '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': '4153164', 'n_tokens_mistral': 473, 'n_tokens_neox': 463, 'n_words': 140}