I'm not sure this is a great idea and you want to request a community. How about using Exception instances to only transfer data and not throw it away? For the situation, I need to transfer the exception information to a container of some type for the purpose of registration or reporting. The Exception data structure is just like the information I need to pass in my program, so I'm considering combining it.
Exception instances are a convenient way to pack information about an exception, which need not be thrown. For example, exceptional data should be returned as status information (such as XML) as a response to a web service call in the application. To do this, I do not need to call the exception handling system and its resources.
Which Exception class is understood at all application levels (in the System namespace), so it can be used as a container without a reference in another assembly or without creating a custom class. Exceptions can also be considered as ordinary objects, for example, return values โโof methods, and they do not need to be thrown.
Plus the app can choose to start throwing them if it ever wishes, I suppose.
source
share