예제 #1
0
        public static ErrorDetails GetLastError()
        {
            int errorCode = GetErrorCode();

            if (KnownErrors.ContainsKey(errorCode))
            {
                return KnownErrors[errorCode];
            }

            string message = Marshal.PtrToStringAnsi(LibXs.xs_strerror(errorCode));

            var errorDetails = new ErrorDetails(errorCode, message);
            KnownErrors[errorCode] = errorDetails;

            return errorDetails;
        }
예제 #2
0
 internal XsException(ErrorDetails errorDetails)
     : this(errorDetails.ErrorCode, errorDetails.Message)
 {
 }
 internal XsDeviceException(ErrorDetails errorDetails)
     : base(errorDetails)
 {
 }
 internal XsSocketException(ErrorDetails errorDetails)
     : base(errorDetails)
 {
 }