Error Class

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Represents an utility class for creating, logging and unwrapping Exception instances.

Inheritance Hierarchy

System.Object
  System.Web.Http.Common.Error

Namespace:  System.Web.Http.Common
Assembly:  System.Web.Http.Common (in System.Web.Http.Common.dll)

Syntax

'Declaration
Public NotInheritable Class Error
public static class Error
public ref class Error abstract sealed
[<AbstractClass>]
[<Sealed>]
type Error =  class end
public final class Error

The Error type exposes the following members.

Methods

  Name Description
Public methodStatic member Argument(String, Object[]) Creates an ArgumentException with the provided properties and logs it with Error.
Public methodStatic member Argument(String, String, Object[]) Creates an ArgumentException with the provided properties and logs it with Error.
Public methodStatic member ArgumentNull(String) Creates an ArgumentNullException with the provided properties and logs it with Error.
Public methodStatic member ArgumentNull(String, String, Object[]) Creates an ArgumentNullException with the provided properties and logs it with Error.
Public methodStatic member ArgumentNullOrEmpty Creates an ArgumentException with a default message and logs it with Error.
Public methodStatic member ArgumentOutOfRange Creates an ArgumentOutOfRangeException with the provided properties and logs it with Error.
Public methodStatic member ArgumentTooLarge Creates an ArgumentOutOfRangeException with a message saying that the argument must be less than or equal to maxValue and logs it with Error.
Public methodStatic member ArgumentTooSmall Creates an ArgumentOutOfRangeException with a message saying that the argument must be greater than or equal to minValue and logs it with Error.
Public methodStatic member ArgumentUriHasQueryOrFragment Creates an ArgumentException with a message saying that the argument must be an absolute URI without a query or fragment identifier and then logs it with Error.
Public methodStatic member ArgumentUriNotAbsolute Creates an ArgumentException with a message saying that the argument must be an absolute URI and logs it with Error.
Public methodStatic member ArgumentUriNotHttpOrHttpsScheme Creates an ArgumentException with a message saying that the argument must be an "http" or "https" URI and logs it with Error.
Public methodStatic member AsError(Exception) Unwraps and logs an Exception as Error.
Public methodStatic member AsError<TPreferredException>(AggregateException) Unwraps and logs an AggregateException as Error using TPreferredException as the preferred unwrapped Exception to return.
Public methodStatic member AsInformation(Exception) Unwraps and logs an Exception as Info.
Public methodStatic member AsInformation<TPreferredException>(AggregateException) Unwraps and logs an AggregateException as Info using TPreferredException as the preferred unwrapped Exception to return.
Public methodStatic member AsVerbose(Exception) Unwraps and logs an Exception as Verbose.
Public methodStatic member AsVerbose<TPreferredException>(AggregateException) Unwraps and logs an AggregateException as Verbose using TPreferredException as the preferred unwrapped Exception to return.
Public methodStatic member AsWarning(Exception) Unwraps and logs an Exception as Warning.
Public methodStatic member AsWarning<TPreferredException>(AggregateException) Unwraps and logs an AggregateException as Warning using TPreferredException as the preferred unwrapped Exception to return.
Public methodStatic member Format Formats the specified resource string using CurrentCulture().
Public methodStatic member InvalidEnumArgument Creates an InvalidEnumArgumentException and logs it with Error.
Public methodStatic member InvalidOperation(String, Object[]) Creates an InvalidOperationException and logs it with Error.
Public methodStatic member InvalidOperation(Exception, String, Object[]) Creates an InvalidOperationException and logs it with Error.
Public methodStatic member KeyNotFound() Creates an KeyNotFoundException with a message saying that the key was not found and logs it with Error.
Public methodStatic member KeyNotFound(String, Object[]) Creates an KeyNotFoundException with a message saying that the key was not found and logs it with Error.
Public methodStatic member NotSupported Creates an NotSupportedException and logs it with Error.
Public methodStatic member ObjectDisposed Creates an ObjectDisposedException initialized according to guidelines and logs it with Error.
Public methodStatic member OperationCanceled() Creates an OperationCanceledException initialized with the provided parameters and logs it with Error.
Public methodStatic member OperationCanceled(String, Object[]) Creates an OperationCanceledException initialized with the provided parameters and logs it with Error.
Public methodStatic member PropertyNull Creates an ArgumentNullException with the provided properties and logs it with Error.

Top

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

System.Web.Http.Common Namespace