Better error messages by raising OSError