Question about Exception classes raised in sampling

I was looking to handle errors in sampling where chains fail (more details if there’s interest), and to do so I was looking at this block of code in the recv_draw static method in parallel_sampling.py:

        if msg[0] == "error":
            warns, old_error = msg[1:]
            if warns is not None:
                error = ParallelSamplingError(str(old_error), proc.chain, warns)
            else:
                error = RuntimeError("Chain %s failed." % proc.chain)
            raise error from old_error

msg is evidently some message received from a subsidiary sampling process, but there’s no mention of what it is. What I would like to know is what distinguishes between the case where warns is and is not None. Why is it that a different error is signaled in each case? Why is the second case simply a RuntimeError instead of a ParallelSamplingError like the first?

Thanks!