Error.cs 811 B

123456789101112131415
  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. namespace System
  5. {
  6. internal static class Error
  7. {
  8. public static Exception ArgumentNull(string paramName) => new ArgumentNullException(paramName);
  9. public static Exception ArgumentOutOfRange(string paramName) => new ArgumentOutOfRangeException(paramName);
  10. public static Exception NoElements() => new InvalidOperationException(Strings.NO_ELEMENTS);
  11. public static Exception MoreThanOneElement() => new InvalidOperationException(Strings.MORE_THAN_ONE_ELEMENT);
  12. public static Exception NotSupported() => new NotSupportedException(Strings.NOT_SUPPORTED);
  13. }
  14. }