어떻게하면됩니까?캐치를 시도하십시오 - 마지막으로 If 문에서 어떻게 진행합니까?
void x()
{....
if (...)
{try
{}
catch (ComException com)
{ throw com}
finally // in any case, executed fine!
{...instructions.......}
}
... instructions...// not executed in case of exception because the finally can't embrace the following code too... but this block of code needs to be executed in any case too...
{}
}
왜 catch 블록에 예외가 발생합니까? –
@Matthew Jones 나는 OP가 catch 블록 내 일부 로깅 코드를 생략하고 있다고 생각합니다. 그렇지 않다면, 잡기와 재위는 의미가 없습니다. –
나는 특별한 예외 인 Com 하나를 잡아서 호출 메소드에 던져야하기 때문에 어쩌면 구문을 밝게 할 수있다. (im in C#) ....하지만 아무 코드도 없다. catch하지만 던져 .... 그렇지 않으면 어떻게 쓰겠 니? – KitAndKat