Show / Hide Table of Contents

Class OnErrorAttributeDecorator

Decorator for IHandlesProcessingError which handles TAL 'on-error' attributes.

This decorator is a little unusual (compared to the others) in that it really just puts a try/catch around whatever it wraps. If there is an error and there is a TAL on-error attribute present upon the node then this decorator will handle the error and prevent the error from halting the whole rendering process.

Inheritance
System.Object
OnErrorAttributeDecorator
Implements
IHandlesProcessingError
IProcessesExpressionContext
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: ZptSharp.Tal
Assembly: ZptSharp.dll
Syntax
public class OnErrorAttributeDecorator : IHandlesProcessingError, IProcessesExpressionContext

Constructors

| Improve this Doc View Source

OnErrorAttributeDecorator(IHandlesProcessingError, IGetsTalAttributeSpecs, IEvaluatesDomValueExpression, ILogger<OnErrorAttributeDecorator>)

Initializes a new instance of the OnErrorAttributeDecorator class.

Declaration
public OnErrorAttributeDecorator(IHandlesProcessingError wrapped, IGetsTalAttributeSpecs specProvider, IEvaluatesDomValueExpression evaluator, ILogger<OnErrorAttributeDecorator> logger)
Parameters
Type Name Description
IHandlesProcessingError wrapped

Wrapped.

IGetsTalAttributeSpecs specProvider

Spec provider.

IEvaluatesDomValueExpression evaluator

Evaluator.

Microsoft.Extensions.Logging.ILogger<OnErrorAttributeDecorator> logger

Logger.

Methods

| Improve this Doc View Source

HandleErrorAsync(Exception, ExpressionContext, CancellationToken)

Handles an error which was encountered whilst processing an expression context.

Declaration
public Task<ErrorHandlingResult> HandleErrorAsync(Exception ex, ExpressionContext context, CancellationToken token = default(CancellationToken))
Parameters
Type Name Description
System.Exception ex

The exception indicating the error.

ExpressionContext context

The context to process.

System.Threading.CancellationToken token

An optional cancellation token.

Returns
Type Description
System.Threading.Tasks.Task<ErrorHandlingResult>

A result object indicating the outcome of error handling.

| Improve this Doc View Source

ProcessContextAsync(ExpressionContext, CancellationToken)

Processes the context using the rules defined within this object.

Declaration
public Task<ExpressionContextProcessingResult> ProcessContextAsync(ExpressionContext context, CancellationToken token = default(CancellationToken))
Parameters
Type Name Description
ExpressionContext context

The context to process.

System.Threading.CancellationToken token

An optional cancellation token.

Returns
Type Description
System.Threading.Tasks.Task<ExpressionContextProcessingResult>

A result object indicating the outcome of processing.

Implements

IHandlesProcessingError
IProcessesExpressionContext
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX