ログ コンテンツを生成しない運用環境で例外があります。この catch ブロックで正常にログに記録されるエラーが本番環境で発生しましたが、何らかの理由で、この特定の例外 (そしてそれが何であるかはわかりません) は何もログに記録しません。キャッチブロックは次のとおりです。
//catch any exception and add it to the list of exceptions, and process next id
catch (Exception e)
{
if (exceptionMessageBuilder.Length != 0)
{
exceptionMessageBuilder.AppendLine("----------------------------------------");
}
exceptionMessageBuilder.AppendFormat("Error occurred in processing id {0}.\n", currentID);
exceptionMessageBuilder.AppendLine(e.ToString());
}
私が得ている唯一の出力は、「ID d455e51f-6c86-4591-b75e-a2d29be73f4c の処理中にエラーが発生しました」です。アプリケーションが終了し、これを電子メールとして送信するため、完全に爆撃することはありません。
通常、次のようなメッセージが表示されます。
Error occurred in processing id 593abf56-5057-400e-bbfb-da819df59710.
System.ServiceModel.FaultException: The communication object, System.ServiceModel.Channels.ServiceChannel, cannot be used for communication because it is in the Faulted state.
Server stack trace:
at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
情報が得られない理由はありますか?null 例外をキャッチすることは可能ですか?