handle errors for #seek and #read