Add try/except snippet