本文整理匯總了C#中System.Exception.Serialize方法的典型用法代碼示例。如果您正苦於以下問題:C# Exception.Serialize方法的具體用法?C# Exception.Serialize怎麽用?C# Exception.Serialize使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Exception
的用法示例。
在下文中一共展示了Exception.Serialize方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: LogException
void LogException(object source, Exception ex)
{
try
{
Elmah.RaiseErrorSignal(ex);
// Rely on ELMAH configuration to filter messages from Log4Net
if (IsFiltered(ex)) return;
source = Type.GetType(ex.GetBaseException().Source, false) ?? Type.GetType(ex.Source, false) ?? source;
Logger.Error(source, ex.Serialize());
}
catch
{
#if DEBUG
Debugger.Break();
#endif
}
}
示例2: log
bool log(IAction action, bool completed, bool reversed, Exception ex)
{
var info = new ActionInfo
{
ID = ID,
BID = BID,
Order = action.Order,
Data = action.GetData().Serialize(),
Result = action.GetResult().Serialize(),
Action = action.GetType().Name,
Exception = ex.Serialize(),
Completed = (ex== null) && completed,
Reversed = (ex == null) && reversed,
VersionTime = DateTime.Now,
IsLast = true
};
lock (lockObj)
{
actionStore[ID].Actions.Add(info);
}
return true;
}
示例3: ForwardToPoisonMessageQueue
private void ForwardToPoisonMessageQueue(Message message, Exception exception)
{
message.Extension = exception.Serialize();
this.poisonQueue.Send(message);
}