Table of Contents

Class Error

Namespace
BotManager.Runtime.Expressions
Assembly
BotManager.Runtime.dll

Writes a log message to the error output.

Return type is null.

This json example writes an error to the output and returns null:
{ "$Error": "This is an error!" }
[JsonConverter(typeof(ErrorConverter))]
public sealed class Error : IExpression
Inheritance
Error
Implements
Inherited Members

Constructors

Error()

Empty constructor for serialization.

public Error()

Error(IExpression?)

Creates an expression that logs the given message in the error output.

public Error(IExpression? message)

Parameters

message IExpression

The expression to resolve the log message.

Properties

Message

Gets and sets the expression to resolve the message to log as error.

[JsonRootProperty]
public IExpression? Message { get; set; }

Property Value

IExpression

Methods

ExecuteAsync(RuntimeContext, Type?)

Executes the expression in the given RuntimeContext. Please do not use this method to run an expression. Use ExecuteAsync(IExpression?) instead.

public Task<object?> ExecuteAsync(RuntimeContext context, Type? returnType)

Parameters

context RuntimeContext

The current runtime context.

returnType Type

The expected return type. Use typeof(object) for a generic result. Use null if you don't need the return value.

Returns

Task<object>

Returns the result of the expression.