Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why would I want to replace an exception?

I am using Enterprise Library 5.0, a tool to manage cross-cutting concerns like logging from.

One of the options the tool gives me is to "replace" an exception. I can see the purpose of wrap in some cases, but why would I ever want to completely replace the exception?

Thanks

like image 979
GurdeepS Avatar asked Feb 26 '23 12:02

GurdeepS


1 Answers

What if the original exception contained sensitive proprietary data, or similar, and you just wanted to replace it wholesale? That might be one occasion when wrapping wasn't appropriate, as what you want to do is strip out the sensitive parts but keep a core set of technical information. I've had similar issues in the past with financial apps, where you don't want to send complete in-house logs to a vendor, for example. In that case it was some effort to explicitly separate sensitive and non-sensitive error handling, to different log sinks.

like image 152
Tim Barrass Avatar answered Feb 28 '23 02:02

Tim Barrass