Is there a way to extract when an exception was thrown from the exception itself, or will I need to manually add this information to the exception?
There is no built-in Timestamp
property for the Exception
object. You can create a new class that inherits from Exception
and add your own property.
If you're using your exception as a parameter of a log framework, you might want to handle the timestamp directly in the log framework (most probably using DateTime.Now
/ UtcNow
).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With