C#: Refactor extractor errors and log extractor errors to the database.

This commit is contained in:
calum
2019-03-25 13:49:40 +00:00
committed by Calum Grant
parent e1158bb5e5
commit 343cddcbb7
41 changed files with 367 additions and 194 deletions

View File

@@ -3,6 +3,7 @@ using System.Globalization;
using System.Collections.Generic;
using Semmle.Util.Logging;
using System;
using Semmle.Extraction.Entities;
namespace Semmle.Extraction.CIL.Entities
{
@@ -70,12 +71,7 @@ namespace Semmle.Extraction.CIL.Entities
}
catch (InternalError e)
{
cx.cx.Extractor.Message(new Message
{
exception = e,
message = "Error processing type definition",
severity = Semmle.Util.Logging.Severity.Error
});
cx.cx.ExtractionError("Error processing type definition", e.Message, GeneratedLocation.Create(cx.cx), e.StackTrace);
}
// Limitation of C#: Cannot yield return inside a try-catch.
@@ -92,12 +88,7 @@ namespace Semmle.Extraction.CIL.Entities
}
catch (InternalError e)
{
cx.cx.Extractor.Message(new Message
{
exception = e,
message = "Error processing bytecode",
severity = Semmle.Util.Logging.Severity.Error
});
cx.cx.ExtractionError("Error processing bytecode", e.Message, GeneratedLocation.Create(cx.cx), e.StackTrace);
}
if (product != null)