PostSharp SDK 6.8 / / Class Reference / Post­Sharp.​Sdk.​Utilities Namespace / Exception­Helper Class

ExceptionHelper Class

Provides methods that retrieve exception messages from an embedded resource and throws an exception.
Inheritance Hierarchy
System.Object
  PostSharp.Sdk.Utilities.ExceptionHelper

Namespace:  PostSharp.Sdk.Utilities
Assembly:  PostSharp.Compiler.Engine (in PostSharp.Compiler.Engine.dll) Version: 6.8.6.0 (6.8.6.0)
Syntax
C#
public class ExceptionHelper

The ExceptionHelper type exposes the following members.

Constructors
  NameDescription
Protected methodExceptionHelper
Initializes a new ExceptionHelper and allows for lazy creation of the ResourceManager that this ExceptionHelper is based on.
Methods
  NameDescription
Public methodAssert
Throws an AssertionFailedException if a condition is not fulfilled.
Public methodStatic memberAssertArgumentNotEmptyOrNull
Throws an ArgumentNullException if a string reference is null or if the referenced string is empty.
Public methodStatic memberAssertArgumentNotNull(Object, String)
Throws an ArgumentNullException if a reference is null.
Public methodStatic memberAssertArgumentNotNull(Void*, String)
Throws an ArgumentNullException if a pointer is null.
Public methodAssertValidArgument
Throws an ArgumentException if a condition is not fulfilled.
Public methodAssertValidOperation
Conditionally throws an InvalidOperationException (message with parameters).
Public methodStatic memberAssume
Tells the static analyzer that the given condition is trusted to be true.
Public methodStatic memberAssumeNotNull<T>
Tells the static analyzer that the given reference is trusted to be non-null.
Public methodStatic memberAssumeNotNullExpression<T>
Tells the static analyzer that the given reference is trusted to be non-null.
Public methodCreateArgumentException
Creates an ArgumentException.
Public methodCreateAssertionFailedException
Creates an AssertionFailedException and reads the message from the resource manager.
Public methodCreateBindingException(String, Object[])
Creates an BindingException.
Public methodCreateBindingException(String, Exception, Object[])
Creates an BindingException and includes an inner exception.
Public methodCreateFileNotFoundException
Creates an FileNotFoundException.
Public methodStatic memberCreateInvalidEnumerationValueException
Creates an AssertionFailedException with a message telling that an enumeration contained an unexpected value.
Public methodCreateInvalidOperationException
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodStatic memberExecuteUserCode(MessageLocation, Action, Type[])
Executes a given Action, catches exceptions and replace them by a fatal error message.
Public methodStatic memberExecuteUserCode<T>(MessageLocation, Func<T>, Type[])
Executes a given Func<TResult>, catches exceptions and replace them by a fatal error message.
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Protected methodGetMessage(String)
Gets an exception message.
Protected methodGetMessage(String, Object[])
Gets an exception message from resources and format it using arguments.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodStatic memberHandleBindingException
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
See Also