Example #1
0
        private void HandleError(Line current, TFunctionData stackFrame, Exception ex)
        {
            TbasicException cEx = ex as TbasicException;

            if (cEx != null)
            {
                int    status = cEx.Status;
                string msg    = stackFrame.Data as string;
                if (string.IsNullOrEmpty(msg))
                {
                    msg = cEx.Message;
                }
                stackFrame.Status = status;
                stackFrame.Data   = msg;
                stackFrame.Context.SetReturns(stackFrame);
                if (ThrowError)
                {
                    throw new LineException(current.LineNumber, current.VisibleName, cEx);
                }
            }
            else
            {
                throw new LineException(current.LineNumber, current.VisibleName, ex);
            }
        }
Example #2
0
 private void Eval(TFunctionData stackFrame)
 {
     stackFrame.AssertParamCount(2);
     try {
         stackFrame.Data = Eval(stackFrame.GetParameter <string>(1));
     }
     catch (Exception ex) {
         throw TbasicException.WrapException(ex);
     }
 }