throw proper exception