阅读背景:

在Java中维护堆栈跟踪时,将自定义消息添加到抛出异常

来源:互联网 

I have a small piece of code that runs through some transactions for processing. Each transaction is marked with a transaction number, which is generated by an outside program and is not necessarily sequenced. When I catch an Exception in the processing code I am throwing it up to the main class and logging it for review later. I'd like to add the transaction number to this thrown Exception. Is it possible to do this while still maintaining the correct stack trace?I have a small piece of code that runs through




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: