catch errors more specifically

we use OSError. Still not perfect but better than nothing.