Add FATAL diagnostic severity to match changes in the current script infrastructure

This commit is contained in:
Ilya Chernikov
2018-03-30 13:33:58 +02:00
parent 599a9acce8
commit 73d2580435
2 changed files with 2 additions and 1 deletions
@@ -13,7 +13,7 @@ data class ScriptDiagnostic(
val location: ScriptSource.Location? = null, val location: ScriptSource.Location? = null,
val exception: Throwable? = null val exception: Throwable? = null
) { ) {
enum class Severity { ERROR, WARNING, INFO, DEBUG } enum class Severity { FATAL, ERROR, WARNING, INFO, DEBUG }
} }
sealed class ResultWithDiagnostics<out R> { sealed class ResultWithDiagnostics<out R> {
@@ -21,6 +21,7 @@ fun mapLegacyDiagnosticSeverity(severity: ScriptDependenciesResolver.ReportSever
} }
fun mapToLegacyScriptReportSeverity(severity: ScriptDiagnostic.Severity): ScriptReport.Severity = when (severity) { fun mapToLegacyScriptReportSeverity(severity: ScriptDiagnostic.Severity): ScriptReport.Severity = when (severity) {
ScriptDiagnostic.Severity.FATAL -> ScriptReport.Severity.FATAL
ScriptDiagnostic.Severity.ERROR -> ScriptReport.Severity.ERROR ScriptDiagnostic.Severity.ERROR -> ScriptReport.Severity.ERROR
ScriptDiagnostic.Severity.WARNING -> ScriptReport.Severity.WARNING ScriptDiagnostic.Severity.WARNING -> ScriptReport.Severity.WARNING
ScriptDiagnostic.Severity.INFO -> ScriptReport.Severity.INFO ScriptDiagnostic.Severity.INFO -> ScriptReport.Severity.INFO