mirror of
https://github.com/github/codeql.git
synced 2026-05-24 16:17:07 +02:00
Add error function taking a throwable to LoggerBase
This commit is contained in:
@@ -292,7 +292,7 @@ fun doAnalysis(
|
||||
// stack overflow or an assertion failure in one file.
|
||||
} catch (e: Throwable) {
|
||||
fileExtractionProblems.setNonRecoverableProblem()
|
||||
loggerBase.error(dtw, "Extraction failed while extracting '${psiFile.virtualFilePath}'.", e.stackTraceToString())
|
||||
loggerBase.error(dtw, "Extraction failed while extracting '${psiFile.virtualFilePath}'.", e)
|
||||
}
|
||||
} else {
|
||||
System.out.println("Warning: Not a KtFile")
|
||||
|
||||
@@ -286,6 +286,10 @@ class LoggerBase(val diagnosticCounter: DiagnosticCounter) : BasicLogger {
|
||||
error(dtw, msg, extraInfo, null)
|
||||
}
|
||||
|
||||
fun error(dtw: DiagnosticTrapWriter, msg: String, exn: Throwable) {
|
||||
error(dtw, msg, exn.stackTraceToString())
|
||||
}
|
||||
|
||||
fun error(dtw: DiagnosticTrapWriter, msg: String, extraInfo: String?, loggerState: LoggerState?) {
|
||||
if (verbosity >= 1) {
|
||||
diagnostic(dtw, Severity.Error, msg, extraInfo, loggerState)
|
||||
@@ -385,7 +389,7 @@ open class Logger(val loggerBase: LoggerBase, val dtw: DiagnosticTrapWriter) : B
|
||||
}
|
||||
|
||||
fun error(msg: String, exn: Throwable) {
|
||||
error(msg, exn.stackTraceToString())
|
||||
loggerBase.error(dtw, msg, exn)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user