Catch exceptions
only catch OSError
Also using the same code for update.py
Merge pull request #251 from c0ff3m4kr/update_fixup

Catch exceptions in update API