Show / Hide Table of Contents

Class Errors

Contains resources that generate new exception instances to be thrown.

Inheritance
object
Errors
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: TheXDS.MCART.Resources
Assembly: MCART.dll
Syntax
public static class Errors

Methods

| Edit this page View Source

BinaryWriteNotSupported(Type, MethodInfo)

Creates a new NotSupportedException indicating that it is not possible to execute a binary write for an object of the specified type.

Declaration
public static NotSupportedException BinaryWriteNotSupported(Type offendingType, MethodInfo alternative)
Parameters
Type Name Description
Type offendingType

Type of the object for which a binary write has been attempted.

MethodInfo alternative

Suggested alternative method for executing the binary write.

Returns
Type Description
NotSupportedException

A new instance of the NotSupportedException class.

| Edit this page View Source

CannotInstanceClass(Type, Exception?)

Creates a new TypeLoadException indicating that the type could not be instantiated with the provided constructor arguments.

Declaration
public static TypeLoadException CannotInstanceClass(Type t, Exception? inner = null)
Parameters
Type Name Description
Type t

Type that is the cause of this exception.

Exception inner

Exception that has been trhown trying to instantiate t.

Returns
Type Description
TypeLoadException

A new instance of the TypeLoadException class.

Remarks

The error will be captured when an error occurs within the constructor of the type to be instantiated. If the class does not contain a constructor that accepts the arguments, call the ClassNotInstantiable(Type?) method instead.

See Also
ClassNotInstantiable(Type?)
| Edit this page View Source

CantWriteObj(Type)

Creates a new InvalidOperationException indicating that the specified object could not be written.

Declaration
public static InvalidOperationException CantWriteObj(Type t)
Parameters
Type Name Description
Type t

Type of the object that could not be written.

Returns
Type Description
InvalidOperationException

A new instance of the InvalidOperationException class.

| Edit this page View Source

CircularOpDetected()

Creates a new InvalidOperationException indicating that executing the operation causes a circular operation.

Declaration
public static InvalidOperationException CircularOpDetected()
Returns
Type Description
InvalidOperationException

A new instance of the InvalidOperationException class.

| Edit this page View Source

ClassNotInstantiable(Type?)

Creates a new ClassNotInstantiableException indicating the type of the class that could not be instantiated.

Declaration
public static ClassNotInstantiableException ClassNotInstantiable(Type? @class = null)
Parameters
Type Name Description
Type class

Type of the class that could not be instantiated.

Returns
Type Description
ClassNotInstantiableException

A new instance of the ClassNotInstantiableException class.

| Edit this page View Source

DuplicateData(object)

Creates a new InvalidOperationException indicating that the operation duplicates previously existing data when this is not a desired scenario.

Declaration
public static InvalidOperationException DuplicateData(object id)
Parameters
Type Name Description
object id

Identifier of the data that has been attempted to be duplicated.

Returns
Type Description
InvalidOperationException

A new instance of the InvalidOperationException class.

| Edit this page View Source

EmptyCollection(IEnumerable)

Creates a new instance of an InvalidOperationException indicating that it is not possible to process the operation because the collection does not contain elements.

Declaration
public static InvalidOperationException EmptyCollection(IEnumerable collection)
Parameters
Type Name Description
IEnumerable collection

Empty collection on which the operation has been attempted to be executed.

Returns
Type Description
InvalidOperationException

A new instance of the InvalidOperationException class.

| Edit this page View Source

EnumExpected(string, Type)

Creates a new InvalidTypeException indicating that the specified type is not a type that inherits from Enum (declared as enum).

Declaration
public static ArgumentException EnumExpected(string argName, Type offendingType)
Parameters
Type Name Description
string argName

Name of the argument that produced the exception.

Type offendingType

Type for which the exception occurred.

Returns
Type Description
ArgumentException

A new instance of the ArgumentException class.

| Edit this page View Source

EnumerableTypeExpected(Type)

Creates a new InvalidTypeException indicating that the specified type is not an enumeration type.

Declaration
public static InvalidTypeException EnumerableTypeExpected(Type offendingType)
Parameters
Type Name Description
Type offendingType

Type for which the exception occurred.

Returns
Type Description
InvalidTypeException

A new instance of the InvalidTypeException class.

| Edit this page View Source

FormatNotSupported(string)

Creates a new FormatException with a predefined formatted message.

Declaration
public static FormatException FormatNotSupported(string offendingFormat)
Parameters
Type Name Description
string offendingFormat

The format string that caused the exception.

Returns
Type Description
FormatException

A new instance of the FormatException class.

| Edit this page View Source

InterfaceNotImplemented(Type)

Creates a new instance of an InvalidOperationException that occurs when a type was expected to implement an interface, but it did not.

Declaration
public static InvalidOperationException InterfaceNotImplemented(Type t)
Parameters
Type Name Description
Type t

The expected interface type.

Returns
Type Description
InvalidOperationException

A new instance of the InvalidOperationException class.

| Edit this page View Source

InterfaceNotImplemented<T>()

Creates a new instance of an InvalidOperationException that occurs when a type was expected to implement an interface, but it did not.

Declaration
public static InvalidOperationException InterfaceNotImplemented<T>()
Returns
Type Description
InvalidOperationException

A new instance of the InvalidOperationException class.

Type Parameters
Name Description
T

The expected interface type.

| Edit this page View Source

InterfaceTypeExpected(Type)

Creates a new InvalidTypeException indicating that the specified type is not an interface.

Declaration
public static InvalidTypeException InterfaceTypeExpected(Type offendingType)
Parameters
Type Name Description
Type offendingType

Type for which the exception occurred.

Returns
Type Description
InvalidTypeException

A new instance of the InvalidTypeException class.

| Edit this page View Source

InvalidReturnValue(Delegate, object?)

Creates a new InvalidReturnValueException indicating that the specified function has returned an invalid value in this context.

Declaration
public static InvalidReturnValueException InvalidReturnValue(Delegate call, object? returnValue)
Parameters
Type Name Description
Delegate call

Function that has returned the invalid value.

object returnValue

Invalid value returned.

Returns
Type Description
InvalidReturnValueException

A new instance of the InvalidReturnValueException class.

| Edit this page View Source

InvalidSelectorExpression()

Creates a new InvalidOperationException with a default message indicating that the specified expression is not a valid member selector.

Declaration
public static InvalidOperationException InvalidSelectorExpression()
Returns
Type Description
InvalidOperationException

A new instance of the InvalidOperationException class.

| Edit this page View Source

InvalidValue(string)

Creates a new ArgumentException indicating that the value provided to an argument is not valid.

Declaration
public static ArgumentException InvalidValue(string argName)
Parameters
Type Name Description
string argName

Name of the argument for which the exception will be generated.

Returns
Type Description
ArgumentException

A new instance of the ArgumentException class.

| Edit this page View Source

InvalidValue(string?, object?, Exception?)

Creates a new ArgumentException indicating that the value provided to an argument is not valid.

Declaration
public static ArgumentException InvalidValue(string? argName, object? value, Exception? inner = null)
Parameters
Type Name Description
string argName

Name of the argument for which the exception will be generated.

object value

The value of the argument that generated the exception.

Exception inner

The exception that is the original cause of this exception.

Returns
Type Description
ArgumentException

A new instance of the ArgumentException class.

| Edit this page View Source

ListMustContainBoth()

Creates a new InvalidOperationException with a default message indicating that a list must contain two specific objects in the context in which the exception is thrown.

Declaration
public static InvalidOperationException ListMustContainBoth()
Returns
Type Description
InvalidOperationException

A new instance of the InvalidOperationException class.

| Edit this page View Source

MinGtMax()

Creates a new ArgumentException indicating that a minimum value is greater than the maximum when specifying a range of values.

Declaration
public static ArgumentException MinGtMax()
Returns
Type Description
ArgumentException

A new instance of the ArgumentException class.

| Edit this page View Source

MissingGuidAttribute(Type)

Creates a new IncompleteTypeException indicating that the type must contain a GuidAttribute in its declaration to be valid in this context.

Declaration
public static IncompleteTypeException MissingGuidAttribute(Type type)
Parameters
Type Name Description
Type type

Type for which the exception occurred.

Returns
Type Description
IncompleteTypeException

A new instance of the IncompleteTypeException class.

| Edit this page View Source

MissingMember(Type, MemberInfo)

Creates a new MissingMemberException indicating that an attempt has been made to access a non-existent member in the specified type.

Declaration
public static MissingMemberException MissingMember(Type type, MemberInfo missingMember)
Parameters
Type Name Description
Type type

Type in which the attempt was made to access the non-existent member.

MemberInfo missingMember

Member that was attempted to be accessed.

Returns
Type Description
MissingMemberException

A new instance of the MissingMemberException class.

| Edit this page View Source

NullArgumentValue(string, string)

Creates a new NullReferenceException with a message indicating an attempt to dereference a field or property of an argument, which resulted in null.

Declaration
public static NullReferenceException NullArgumentValue(string valuePath, string argumentName)
Parameters
Type Name Description
string valuePath

Path to the field or property being dereferenced.

string argumentName

Name of the argument.

Returns
Type Description
NullReferenceException

A new instance of the NullReferenceException class.

| Edit this page View Source

NullItem(int)

Creates a new exception of type NullItemException that can be thrown whenever an item inside a collection is null.

Declaration
public static NullItemException NullItem(int index)
Parameters
Type Name Description
int index

Index of the item that is null.

Returns
Type Description
NullItemException

A new instance of the NullItemException class.

| Edit this page View Source

PropIsReadOnly(PropertyInfo)

Creates a new InvalidOperationException indicating that the property is read-only.

Declaration
public static InvalidOperationException PropIsReadOnly(PropertyInfo prop)
Parameters
Type Name Description
PropertyInfo prop

Property for which the exception has been generated.

Returns
Type Description
InvalidOperationException

A new instance of the InvalidOperationException class.

| Edit this page View Source

Tamper()

Creates a new TamperException indicating that the application has entered an unexpected state.

Declaration
public static Exception Tamper()
Returns
Type Description
Exception

A new instance of the TamperException class.

| Edit this page View Source

UndefinedEnum(Type, string, Enum)

Creates a new ArgumentOutOfRangeException indicating that the value is outside the defined values of the enumeration.

Declaration
public static ArgumentOutOfRangeException UndefinedEnum(Type enumType, string argName, Enum offendingValue)
Parameters
Type Name Description
Type enumType

The enumeration type.

string argName

Name of the argument for which the exception will be generated.

Enum offendingValue

Value that caused the exception.

Returns
Type Description
ArgumentOutOfRangeException

A new instance of the ArgumentOutOfRangeException class.

| Edit this page View Source

UndefinedEnum<T>(string, T)

Creates a new ArgumentOutOfRangeException indicating that the value is outside the defined values of the enumeration.

Declaration
public static ArgumentOutOfRangeException UndefinedEnum<T>(string argName, T offendingValue) where T : Enum
Parameters
Type Name Description
string argName

Name of the argument for which the exception will be generated.

T offendingValue

Value that caused the exception.

Returns
Type Description
ArgumentOutOfRangeException

A new instance of the ArgumentOutOfRangeException class.

Type Parameters
Name Description
T

The enumeration type.

| Edit this page View Source

UnexpectedType(Type, Type)

Creates a new InvalidTypeException indicating that the specified type is not a valid type.

Declaration
public static InvalidTypeException UnexpectedType(Type offendingType, Type expectedType)
Parameters
Type Name Description
Type offendingType

Type for which the exception occurred.

Type expectedType

Type expected by the code that threw the exception.

Returns
Type Description
InvalidTypeException

A new instance of the InvalidTypeException class.

| Edit this page View Source

ValueOutOfRange(string, object, object)

Creates a new ArgumentOutOfRangeException indicating that the value of the argument is outside of a specific range of values.

Declaration
public static ArgumentOutOfRangeException ValueOutOfRange(string argName, object min, object max)
Parameters
Type Name Description
string argName

Name of the argument for which the exception will be generated.

object min

Minimum accepted value.

object max

Maximum accepted value.

Returns
Type Description
ArgumentOutOfRangeException

A new instance of the ArgumentOutOfRangeException class.

  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX