CallbackException.cs 1.0 KB

12345678910111213141516171819202122232425262728
  1. //-----------------------------------------------------------------------------
  2. // Copyright (c) Microsoft Corporation. All rights reserved.
  3. //-----------------------------------------------------------------------------
  4. namespace System.Runtime
  5. {
  6. using System;
  7. using System.Runtime.Serialization;
  8. [Serializable]
  9. class CallbackException : FatalException
  10. {
  11. public CallbackException()
  12. {
  13. }
  14. public CallbackException(string message, Exception innerException) : base(message, innerException)
  15. {
  16. // This can't throw something like ArgumentException because that would be worse than
  17. // throwing the callback exception that was requested.
  18. Fx.Assert(innerException != null, "CallbackException requires an inner exception.");
  19. Fx.Assert(!Fx.IsFatal(innerException), "CallbackException can't be used to wrap fatal exceptions.");
  20. }
  21. protected CallbackException(SerializationInfo info, StreamingContext context) : base(info, context)
  22. {
  23. }
  24. }
  25. }