Click or drag to resize

NerdyDuck.CodedExceptions Namespace

[This is preliminary documentation and is subject to change.]

The NerdyDuck.CodedExceptions namespace contains classes derived from System.Exception that expose constructors that you can use to set the HResult property. The simplest version is the CodedException class, but most common exceptions are present like the ArgumentException or FormatException. It also contains the CodedExceptionAttribute that you can use to signal that an exception may contain custom HResult values, when creating your own exception classes. The HResultHelper class offers static methods to create standardized HRESULT values. If you want to set an assembly-wide facility identifier to use in your HRESULTs, use the AssemblyFacilityIdentifierAttribute to decorate the assembly, and its static methods to retrieve the facility identifier value.
Classes
  ClassDescription
Public classCode exampleAssemblyFacilityIdentifierAttribute
When applied to an assembly, specifies the facility id of the assembly when creating HResult values for coded exceptions.
Public classCodedAggregateException
Represents one or more errors that occur during application execution. This exception provides constructors to set custom HResult values.
Public classCodedArgumentException
The exception that is thrown when one of the arguments provided to a method is not valid. This exception provides constructors to set custom HResult values.
Public classCodedArgumentNullException
The exception that is thrown when a reference (Nothing in Visual Basic) is passed to a method that does not accept it as a valid argument. This exception provides constructors to set custom HResult values.
Public classCodedArgumentNullOrEmptyException
The exception that is thrown when one of the string arguments provided to a method is (Nothing in Visual Basic) or empty. This exception provides constructors to set custom HResult values.
Public classCodedArgumentNullOrWhiteSpaceException
The exception that is thrown when one of the string arguments provided to a method is (Nothing in Visual Basic), empty, or contains only white-space characters. This exception provides constructors to set custom HResult values.
Public classCodedArgumentOutOfRangeException
The exception that is thrown when the value of an argument is outside the allowable range of values as defined by the invoked method. This exception provides constructors to set custom HResult values.
Public classCodedCommunicationException
Represents a communication error in either the service or client application. This exception provides constructors to set custom HResult values.
Public classCodedDataException
Represents the exception that is thrown when errors are generated using ADO.NET components. This exception provides constructors to set custom HResult values.
Public classCodedException
Represents errors that occur during application execution. This exception provides constructors to set custom HResult values.
Public classCode exampleCodedExceptionAttribute
When applied to a class that inherits from Exception, specifies that the HResult property contains a custom error code.
Public classCodedFormatException
The exception that is thrown when the format of an argument does not meet the parameter specifications of the invoked method. This exception provides constructors to set custom HResult values.
Public classCodedInvalidCastException
The exception that is thrown for invalid casting or explicit conversion. This exception provides constructors to set custom HResult values.
Public classCodedInvalidOperationException
The exception that is thrown when a method call is invalid for the object's current state. This exception provides constructors to set custom HResult values.
Public classCodedNotSupportedException
The exception that is thrown when an invoked method is not supported, or when there is an attempt to read, seek, or write to a stream that does not support the invoked functionality. This exception provides constructors to set custom HResult values.
Public classCodedProtocolViolationException
The exception that is thrown when an error is made while using a network protocol. This exception provides constructors to set custom HResult values.
Public classCodedSerializationException
The exception thrown when an error occurs during serialization or deserialization. This exception provides constructors to set custom HResult values.
Public classCodedSocketException
The exception that is thrown when a socket error occurs. This exception provides constructors to set custom HResult values.
Public classCodedTimeoutException
The exception that is thrown when the time allotted for a process or operation has expired. This exception provides constructors to set custom HResult values.
Public classCodedTypeLoadException
The exception that is thrown when type-loading failures occur. This exception provides constructors to set custom HResult values.
Public classCodedXmlException
The exception thrown when an error occurs while handling an XML document or stream. This exception provides constructors to set custom HResult values.
Public classExceptionExtensions
Extends the Exception class with methods to easily handle coded exceptions.
Public classHResultHelper
Helper class to create and examine custom HResult values.