I am analyzing errors in a legacy application as I clean it up and improve it. I have some stack traces being logged to the database, but there is a limit (VARCHAR2(1000)) to how much it is storing, and errors are occurring deep within System.Data…
at System.Data.OracleClient.OracleConnection.CheckError(OciErrorHandle errorHandle, Int32 rc)
at System.Data.OracleClient.OracleCommand.Execute(OciStatementHandle statementHandle, CommandBehavior behavior, Boolean needRowid, OciRowidDescriptor& rowidDescriptor, ArrayList& resultParameterOrdinals)
at System.Data.OracleClient.OracleCommand.Execute(OciStatementHandle statementHandle, CommandBehavior behavior, ArrayList& resultParameterOrdinals)
at System.Data.OracleClient.OracleCommand.ExecuteReader(CommandBehavior behavior)
at System.Data.OracleClient.OracleCommand.ExecuteDbDataReader(CommandBehavior behavior)
at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
I don’t care about all this stuff – I just need to find which C# code and which proc is generating the errors. So I can figure out the root cause, refactor the code to quality and improve each module as I hit the lowest-hanging most-error-producing code.
Before I go off and write something, does someone have something which will limit the stack trace to certain assemblies so I can get to the root cause? Or a stack trace parser or something off the shelf which I can use to strip out the stuff I’m not interested in before logging the error?
I ended up just using a Regex to remove the lines I didn’t want: