コード例 #1
0
        public void ExceptionTranslationForUnknownNativeError()
        {
            var errorCode = -2147024784;

            try
            {
                InteropHelpers.TranslateError(errorCode);
                Assert.Fail("Exception expected");
            }
            catch (Exception ex)
            {
                ValidateException(ex, errorCode);
            }
        }
コード例 #2
0
 internal unsafe void CreateFromNative(IntPtr pointer)
 {
     NativeTypes.NODE_TRANSITION_RESULT nativeResult = *(NativeTypes.NODE_TRANSITION_RESULT *)pointer;
     this.NodeResult = NodeResult.CreateFromNative(nativeResult.NodeResult);
     this.ErrorCode  = nativeResult.ErrorCode;
     try
     {
         this.Exception = InteropHelpers.TranslateError(this.ErrorCode);
     }
     catch (FabricException)
     {
         // Exception could not be translated.  To the user, it will look like whole FabricClient API itself failed,
         // instead of just the translation above, and they won't be able to determine what happened.  So
         // instead, suppress this.  The user will still have this.ErrorCode.  We will still
         // be able to catch and fix situations that hit this case in test automation because
         // there be a check on this.Exception there.
     }
 }