internal static void ThrowOnFailure(MsgStorageErrorCode errorCode, int hResult, string errorMessage) { if (hResult != 0) { throw new MsgStorageException(errorCode, errorMessage, hResult); } }
internal static void InvokeComCall(MsgStorageErrorCode errorCode, Util.ComCall comCall) { try { comCall(); } catch (IOException exc) { throw new MsgStorageException(errorCode, MsgStorageStrings.ComExceptionThrown, exc); } catch (COMException ex) { if (ex.ErrorCode == -2147287038) { throw new MsgStorageNotFoundException(errorCode, MsgStorageStrings.ComExceptionThrown, ex); } throw new MsgStorageException(errorCode, MsgStorageStrings.ComExceptionThrown, ex); } }
internal MsgStorageException(MsgStorageErrorCode errorCode, string message) : base(string.Format("{0}, Errorcode = {1}", message, errorCode)) { this.errorCode = errorCode; }
internal MsgStorageException(MsgStorageErrorCode errorCode, string message, Exception exc) : base(message, exc) { this.errorCode = errorCode; }
internal MsgStorageException(MsgStorageErrorCode errorCode, string message, int hResult) : base(string.Format("{0}, Errorcode = {1}, HResult = {1}", message, errorCode, hResult)) { base.HResult = hResult; this.errorCode = errorCode; }
internal MsgStorageNotFoundException(MsgStorageErrorCode errorCode, string message, Exception exc) : base(errorCode, message, exc) { }