OverflowException.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // Licensed to the .NET Foundation under one or more agreements.
  2. // The .NET Foundation licenses this file to you under the MIT license.
  3. // See the LICENSE file in the project root for more information.
  4. /*=============================================================================
  5. **
  6. **
  7. **
  8. ** Purpose: Exception class for Arithmetic Overflows.
  9. **
  10. **
  11. =============================================================================*/
  12. using System.Runtime.Serialization;
  13. namespace System
  14. {
  15. [Serializable]
  16. [System.Runtime.CompilerServices.TypeForwardedFrom("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
  17. public class OverflowException : ArithmeticException
  18. {
  19. public OverflowException()
  20. : base(SR.Arg_OverflowException)
  21. {
  22. HResult = HResults.COR_E_OVERFLOW;
  23. }
  24. public OverflowException(string message)
  25. : base(message)
  26. {
  27. HResult = HResults.COR_E_OVERFLOW;
  28. }
  29. public OverflowException(string message, Exception innerException)
  30. : base(message, innerException)
  31. {
  32. HResult = HResults.COR_E_OVERFLOW;
  33. }
  34. protected OverflowException(SerializationInfo info, StreamingContext context) : base(info, context)
  35. {
  36. }
  37. }
  38. }