IKVM11  11
Java SE 11 Virtual Machine for .NET
Loading...
Searching...
No Matches
FatalCompilerErrorException.cs
Go to the documentation of this file.
1using System;
2
4
6{
7
8 sealed class FatalCompilerErrorException : Exception
9 {
10
17 static string FormatDiagnosticLevel(DiagnosticLevel level)
18 {
19 return level switch
20 {
21 DiagnosticLevel.Trace => "trace",
22 DiagnosticLevel.Info => "info",
23 DiagnosticLevel.Warning => "warning",
24 DiagnosticLevel.Error => "error",
25 DiagnosticLevel.Fatal => "fatal",
26 _ => throw new InvalidOperationException(),
27 };
28 }
29
30 readonly DiagnosticEvent _event;
31
37#if NET8_0_OR_GREATER
38 base($"{FormatDiagnosticLevel(evt.Diagnostic.Level)} IKVM{evt.Diagnostic.Id:D4}: {string.Format(null, evt.Diagnostic.Message, evt.Args)}")
39#else
40 base($"{FormatDiagnosticLevel(evt.Diagnostic.Level)} IKVM{evt.Diagnostic.Id:D4}: {string.Format(null, evt.Diagnostic.Message, evt.Args)}")
41#endif
42 {
43 _event = evt;
44 }
45
49 public DiagnosticEvent Event => _event;
50
51 }
52
53}
DiagnosticEvent Event
Gets the event that triggered this exception.
DiagnosticLevel
Represents the level of security of a diagnostic event.