def parse_message(error_msg):
    """This function parses error messages when necessary to prepare them for translation.

    :param error_msg: The original error message
    :type error_msg: str
    :returns: The prepared error message
    """
    split_sequences = ['\n', '\r']
    for sequence in split_sequences:
        if sequence in error_msg:
            error_msg = error_msg.split(sequence)[0]
            break
    return error_msg