Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
ExceptionHandler.cs
Go to the documentation of this file.
3
5
6internal sealed class ExceptionHandler
7{
8 private readonly Type _exceptionType;
9
10 public readonly int LabelIndex;
11
12 public readonly int HandlerStartIndex;
13
14 public readonly int HandlerEndIndex;
15
16 public readonly ExceptionFilter Filter;
17
18 internal ExceptionHandler(int labelIndex, int handlerStartIndex, int handlerEndIndex, Type exceptionType, ExceptionFilter filter)
19 {
20 LabelIndex = labelIndex;
21 _exceptionType = exceptionType;
22 HandlerStartIndex = handlerStartIndex;
23 HandlerEndIndex = handlerEndIndex;
24 Filter = filter;
25 }
26
27 public bool Matches(Type exceptionType)
28 {
29 return _exceptionType.IsAssignableFrom(exceptionType);
30 }
31
32 public override string ToString()
33 {
35 DefaultInterpolatedStringHandler handler = new DefaultInterpolatedStringHandler(13, 3, invariantCulture);
36 handler.AppendLiteral("catch (");
38 handler.AppendLiteral(") [");
40 handler.AppendLiteral("->");
42 handler.AppendLiteral("]");
43 return string.Create(invariantCulture, ref handler);
44 }
45}
static CultureInfo InvariantCulture
ExceptionHandler(int labelIndex, int handlerStartIndex, int handlerEndIndex, Type exceptionType, ExceptionFilter filter)
virtual bool IsAssignableFrom([NotNullWhen(true)] Type? c)
Definition Type.cs:1561