if(!isValid())
{
throw new Exception();
}

// 正常処理
do();