Split up the try-except block when adding the PID and DOI values.