<commit_before>import logging
from baseaction import BaseAction
import os
from ..processingthread import UploadStatus, na

log = logging.getLogger(__name__)

class Cleanup(BaseAction):
    """
    A special file action that is invoked when a file needs to be cleaned up.
    Unlike the other actions, this one doesn't return its file. This is a 
    terminal action.
    """
    def process(self, file):
        UploadStatus(
            file.get('msg', "File Successfully Uploaded"),
            file.get('na', na.NOTHING),
            file
        )

        try:
            os.remove(file['fname'])
        except:
            pass<commit_msg>Fixed cleanup handler to through errors appropriately<commit_after>import logging
from baseaction import BaseAction
import os
from ..processingthread import UploadStatus, na

log = logging.getLogger(__name__)

class Cleanup(BaseAction):
    """
    A special file action that is invoked when a file needs to be cleaned up.
    Unlike the other actions, this one doesn't return its file. This is a 
    terminal action.
    """
    def process(self, file):
        UploadStatus(
            file.get('msg', "File Successfully Uploaded"),
            file.get('na', na.NOTHING),
            file
        )

        if os.path.exists(file['fname']):
            os.remove(file['fname'])
{'fraction_non_alphanumeric': 0.08947368421052632, 'fraction_numerical': 0.0, 'mean_word_length': 2.5211640211640214, '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': '6333669', 'n_tokens_mistral': 360, 'n_tokens_neox': 350, 'n_words': 128}