Update swclustering.py

log errors rather than print