FatalException.cs 1.0 KB

123456789101112131415161718192021222324252627282930
  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 FatalException : SystemException
  10. {
  11. public FatalException()
  12. {
  13. }
  14. public FatalException(string message) : base(message)
  15. {
  16. }
  17. public FatalException(string message, Exception innerException) : base(message, innerException)
  18. {
  19. // This can't throw something like ArgumentException because that would be worse than
  20. // throwing the fatal exception that was requested.
  21. Fx.Assert(innerException == null || !Fx.IsFatal(innerException), "FatalException can't be used to wrap fatal exceptions.");
  22. }
  23. protected FatalException(SerializationInfo info, StreamingContext context) : base(info, context)
  24. {
  25. }
  26. }
  27. }