Exemplo n.º 1
0
 public static bool IsValidExpression(string expression)
 {
     using (var pin = new PinCollection())
     {
         return(NativeTypes.FromBOOLEAN(NativeCommon.FabricIsValidExpression(pin.AddBlittable(expression))));
     }
 }
Exemplo n.º 2
0
        private static string GetErrorDetails()
        {
            string errorDetails = null;

            try
            {
                var nativeMsg  = NativeCommon.FabricGetLastErrorMessage();
                var managedMsg = StringResult.FromNative(nativeMsg);

                if (!string.IsNullOrEmpty(managedMsg))
                {
                    errorDetails = managedMsg;
                }
            }
            catch (Exception e)
            {
                // non-critical: just ignore error and use default error messages
                //
                AppTrace.TraceSource.WriteWarning(
                    "Utility.GetErrorDetails",
                    "Failed to get error details: {0}",
                    e);
            }

            return(errorDetails);
        }
Exemplo n.º 3
0
 // Copies the exception message and stack trace to ErrorThreadMessage
 public void HandleException(Exception ex)
 {
     if (this.CopyExceptionDetailsToThreadErrorMessage)
     {
         using (var pin = new PinCollection())
         {
             NativeCommon.FabricSetLastErrorMessage(pin.AddObject(CreateThreadErrorMessage(ex, this.ShouldIncludeStackTraceInThreadErrorMessage)));
         }
     }
 }