static public CreateFrom ( |
||
ex | Exception for which data must be created. Can be null: null is returned. | |
return |
/// <summary> /// If <see cref="ExceptionData"/> is null, this method creates the <see cref="CKExceptionData"/> /// with the details from this exception. /// </summary> /// <returns>The <see cref="CKExceptionData"/> that describes this exception.</returns> public CKExceptionData EnsureExceptionData() { if (_exceptionData == null) { var inner = CKExceptionData.CreateFrom(InnerException); _exceptionData = new CKExceptionData(Message, "CKException", GetType().AssemblyQualifiedName, StackTrace, inner, null, null, null, null); } return(_exceptionData); }
/// <summary> /// Gets or creates the <see cref="CKExceptionData"/> that captures exception information. /// If <see cref="P:Exception"/> is null, this returns null. /// </summary> /// <returns>A data representation of the exception or null.</returns> public CKExceptionData EnsureExceptionData() { return(_exceptionData ?? (_exceptionData = CKExceptionData.CreateFrom(_exception))); }