mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
99fac4ca56
* fix: Expose WorkflowErrorEvent as ErrorContent When hosted using .AsAgent(), Workflows were not exposing inner errors coming as Exceptions (through the WorkflowErrorEvent) The fix is to convert their message to an ErrorContent on the way out, rather than rely on the default "empty update" to collect the raw event. * feat: Add a way to show/suppress exception information
20 lines
550 B
C#
20 lines
550 B
C#
// Copyright (c) Microsoft. All rights reserved.
|
|
|
|
using System;
|
|
|
|
namespace Microsoft.Agents.AI.Workflows;
|
|
|
|
/// <summary>
|
|
/// Event triggered when a workflow encounters an error.
|
|
/// </summary>
|
|
/// <param name="e">
|
|
/// Optionally, the <see cref="Exception"/> representing the error.
|
|
/// </param>
|
|
public class WorkflowErrorEvent(Exception? e) : WorkflowEvent(e)
|
|
{
|
|
/// <summary>
|
|
/// Gets the exception that caused the current operation to fail, if one occurred.
|
|
/// </summary>
|
|
public Exception? Exception => this.Data as Exception;
|
|
}
|