Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ HasHandler()

bool System.Linq.Expressions.Interpreter.TryCatchFinallyHandler.HasHandler ( InterpretedFrame frame,
Exception exception,
[NotNullWhen(true)] out ExceptionHandler handler,
out object unwrappedException )
inlinepackage

Definition at line 41 of file TryCatchFinallyHandler.cs.

42 {
43 frame.SaveTraceToException(exception);
45 {
47 unwrappedException = ((ex != null) ? ex.WrappedException : exception);
48 Type type = unwrappedException.GetType();
49 ExceptionHandler[] handlers = _handlers;
50 foreach (ExceptionHandler exceptionHandler in handlers)
51 {
52 if (exceptionHandler.Matches(type) && (exceptionHandler.Filter == null || FilterPasses(frame, ref unwrappedException, exceptionHandler.Filter)))
53 {
54 handler = exceptionHandler;
55 return true;
56 }
57 }
58 }
59 else
60 {
61 unwrappedException = null;
62 }
63 handler = null;
64 return false;
65 }
static bool FilterPasses(InterpretedFrame frame, ref object exception, ExceptionFilter filter)

References System.Linq.Expressions.Interpreter.TryCatchFinallyHandler._handlers, System.exception, System.Linq.Expressions.Interpreter.ExceptionHandler.Filter, System.Linq.Expressions.Interpreter.TryCatchFinallyHandler.FilterPasses(), System.Type.GetType(), System.Linq.Expressions.Interpreter.TryCatchFinallyHandler.IsCatchBlockExist, System.Linq.Expressions.Interpreter.ExceptionHandler.Matches(), System.Linq.Expressions.Interpreter.InterpretedFrame.SaveTraceToException(), System.type, and System.Runtime.CompilerServices.RuntimeWrappedException.WrappedException.

Referenced by System.Linq.Expressions.Interpreter.EnterTryCatchFinallyInstruction.Run().