Is it possible (to exclude) using Exception.HelpLink to recognize Exception objects?

I am working on a logging program, and I would like to repeatedly process the same object Exceptionwhen it is registered many times because it leaks through the structure of nested calls. Therefore, I would like to be able to format the object Exceptiononce and provide the formatted version with a unique "exception number", and then mark the object Exceptionso that I can recognize it if it appears again in a later version of log call.

The idea that I came up with is to misuse the HelpLinkobject field Exception. I installed it to contain a lowercase version of my "exception number". Then I can recognize the object Exceptionif it reappears again in another call to the log.

But maybe this is a bad idea? Are there any problems that I did not think about? If so, does anyone have a better idea?

EDIT: To explain the situation a bit more, this registrar will only be used in my own programs.

+5
source share
5 answers

"" HelpLink Data , Exception. /, .

+7

TheVillageIdiot, , , Exception, , . .:)

+3

, Exception.HelpLink , . , , .

log4net / , / log4.net

+2

. HelpLink. @Greebo, , . Data, System.Exception.

: - , ?

, , , . (, , ), . , , . , , , , .

0

. , - . , "catch every exception", -.

0

All Articles