<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="8.15.0" />

Microsoft.IdentityModel.Tokens.Experimental.ValidationError

public class ValidationError
Represents an error that occurred during a SecurityToken validation.
protected Exception Exception { get; protected set; }

Gets or sets the exception associated with the ValidationError.

Gets the type of validation failure that occurred.

public Exception InnerException { get; }

Gets the inner exception that occurred.

public string Message { get; }

Gets the message that contains details of the error.

public IList<StackFrame> StackFrames { get; }

Gets the stack frames where the exception occurred.

public static StackFrame GetCurrentStackFrame(string filePath = "", int lineNumber = 0, int skipFrames = 1)

Returns the stack frame corresponding to the file path and line number from which this method is called. If there is no cache entry for the given file path and line number, a new stack frame is created and added to the cache.

public static ValidationError NullParameter(string parameterName, StackFrame stackFrame)

Creates a new instance of ValidationError representing a null parameter.

public ValidationError AddCurrentStackFrame(string filePath = "", int lineNumber = 0, int skipFrames = 1)

Adds the current stack frame to the list of stack frames and returns the updated object. If there is no cache entry for the given file path and line number, a new stack frame is created and added to the cache.

Adds a stack frame to the list of stack frames and returns the updated object.

public virtual Exception GetException()

Creates and returns instance of an Exception using FailureType