Update ocr.py

make exception handling explicit