ModelFactoryGenerateLogForException Method

Generates a log for an exception.

Definition

Namespace: MobileTrack.Common.Extensions
Assembly: MobileTrack.Common (in MobileTrack.Common.dll) Version: 0.8+34f1bbd8dc6b32752cfce829cbed66e15113d7ba
public static LogDto GenerateLogForException(
	EventId exceptionEvent,
	Exception exception
)

Parameters

exceptionEvent  EventId
The EventId related to the exception
exception  Exception
The exception itself

Return Value

LogDto
Generated LogDto for exception objects

Remarks

The irony of throwing an exception while logging an exception is not lost on me, but it's a necessary evil; if we cannot save the exception to the database, it will break the application, which is a lot worse.

Exceptions

ArgumentExceptionThrown if exceptionEvent is 0.
ArgumentNullExceptionThrown if exception is

See Also