Doloro GDK 22 .1.0 Beta
by Tauri Interactive
Errors List

About

The plugin for Doloro AI debug environment. Provides API for source validation and informing of the developer about found issues.

Developers API

Sending message to console

You able to send the custom message to console manually by using the code similar to the next one:

DebugToolsHelper.GetTool<ErrorsList>().SendMessage(
SOURCE,
BRUNCH_PATH,
MESSAGE,
MESSAGE_TYPE);

Source could be provided as PipelineMap instance. In that case the tool automatically builds source path to display. Otherwise, you could use you custom string message as source to apply.

Extension creation

You can implement your own validators that will checks is the source going along with your stability rules. For this just create the class derived from the Doloro.AI.DAIDebugger.ErrorsListTool.ABehaviorValidator class.

Implement the OnValid handler. The handler returns validation state. In case of false the tool will automatically generate the message along with data that you define in Type and Message properties during validation pass.

Example

The following example implements validator that looking for string properties without defined values.

using Doloro.AI.Core;
using System;
namespace Doloro.AI.DAIDebugger.ErrorsListTool
{
public class StringPropertiesValidator : ABehaviorValidator
{
public override bool OnValid(PipelineMap node, System.Action onInvalid)
{
Message = null;
Type = UnityEditor.MessageType.None;
bool isValid = true;
foreach(var data in node.binaryData)
{
if(data.value is string str)
{
if(string.IsNullOrWhiteSpace(str))
{
// Consider as warning.
Type = UnityEditor.MessageType.Warning;
Message = "`" + data.Key + "` property value is null or whitespace.";
// Handling invalid parameter.
if(onInvalid != null)
{
try { onInvalid?.Invoke(); }
catch (Exception ex)
{
// Informing developer about occurred exception.
DebugToolsHelper.GetTool<ErrorsList>().SendMessage(
node,
node.title + "." + data.Key + ": " +
"`onInvalid` handler caused unexpected exception.\n" + ex.Message,
UnityEditor.MessageType.Error);
}
}
isValid = false;
}
}
}
return isValid;
}
}
}