Raise error when OSError occurred