From d58e255b3f009e927865ec11e132002d32d0048c Mon Sep 17 00:00:00 2001 From: PopSlime Date: Sun, 6 Nov 2022 12:12:51 +0800 Subject: [PATCH] Update operator exception handling. --- Assets/Cryville/Common/Pdt/PdtOperator.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Assets/Cryville/Common/Pdt/PdtOperator.cs b/Assets/Cryville/Common/Pdt/PdtOperator.cs index ac48982..7732ac5 100644 --- a/Assets/Cryville/Common/Pdt/PdtOperator.cs +++ b/Assets/Cryville/Common/Pdt/PdtOperator.cs @@ -47,7 +47,10 @@ namespace Cryville.Common.Pdt { internal void Call(byte* prmem, bool noset) { _prmem = prmem; _rfreq = false; - try { Execute(); } catch (Exception) { _failure = true; } + try { Execute(); } catch (Exception ex) { + if (_rfreq) _etor.DiscardStack(); + throw new InvalidOperationException("Evaluation failed", ex); + } if (_failure) { if (_rfreq) _etor.DiscardStack(); throw new InvalidOperationException("Evaluation failed");