I like the idea of splitting out a separate function for this, to avoid bloating the other. It doesn't feel right in that case to entangle them by using this condition here which is copy/pasted from the downstream exception handler.