开发者

Should I make my CustomException serializable?

开发者 https://www.devze.com 2023-02-09 04:54 出处:网络
I\'m defining a custom exception class to signal to my handler for a specific action to be taken. I\'m wondering if I should make my exception Serializable or not. I don\'t intend to use the exception

I'm defining a custom exception class to signal to my handler for a specific action to be taken. I'm wondering if I should make my exception Serializable or not. I don't intend to use the exception as anything more than an exit from my current execution.

开发者_StackOverflow中文版

(and yes, I do need a custom exception class. I'm pretty sure about that)


The best practice is to make them serializable. This way they can be serialized across AppDomain, or even process, boundaries.

0

精彩评论

暂无评论...
验证码 换一张
取 消