try catch ブロックを使用せずに、スローされた例外をファイルに書き込むことは可能ですか?
例えば
public static void method() throws Exception, SQLException{
if(Exception is thrown){
write Exception to out.txt;
write SQLException to out.txt;
}
}
または、次のことを行う必要がありますか?
public static void method(){
try{
...
}catch(Exception ex){
write ex to file;
}catch(SQLException sqlex){
write sqlex to file;
}
}