def check_picard_for_errors(picard_stderr):
    """
        Checks the picard stderr for errors

        Parameters
        ----------
        picard_stderr : str
            picard stderr

        Raises
        ------
        IOError
            If picard stderr returns an error
    """
    if 'Elapsed time:' in picard_stderr:
        pass
    elif 'Exception' in picard_stderr:
        for picard_stderr_line in picard_stderr.splitlines():
            if 'Exception' in picard_stderr_line:
                raise Exception(picard_stderr_line)
    elif picard_stderr:
        raise Exception(picard_stderr)
