Update processing.py

fix exception handling