Table of Contents

Class ErrorReport

Namespace
nadena.dev.ndmf

Contains any errors or warnings issued during a single build operation.

public sealed class ErrorReport
Inheritance
ErrorReport
Inherited Members

Properties

AvatarName

The name of the avatar being processed

public string AvatarName { get; }

Property Value

string

AvatarRootPath

The path (from the scene root) of the avatar being processed

public string AvatarRootPath { get; }

Property Value

string

Errors

A list of reported errors.

public ImmutableList<ErrorContext> Errors { get; }

Property Value

ImmutableList<ErrorContext>

Methods

CaptureErrors(Action)

Runs the given action, capturing all errors and returning any errors generated. Intended for unit testing only.

public static List<ErrorContext> CaptureErrors(Action action)

Parameters

action Action

Returns

List<ErrorContext>

Clear()

Clears all error reports.

public static void Clear()

ReportError(IError)

Adds an error to the currently active error report. If no error report is active, the error will simply be logged to the debug log.

public static void ReportError(IError error)

Parameters

error IError

ReportError(Localizer, ErrorSeverity, string, params object[])

Helper to report a SimpleError.

public static void ReportError(Localizer localizer, ErrorSeverity errorSeverity, string key, params object[] args)

Parameters

localizer Localizer

The Localizer used to look up translations

errorSeverity ErrorSeverity

The severity of the error

key string

The prefix used to find localization keys

args object[]

Inline substitutions and unity objects to reference from the error

ReportException(Exception, string)

Helper to report an exception. This will generate an error of InternalError severity.

public static void ReportException(Exception e, string additionalStackTrace = null)

Parameters

e Exception

Exception to report

additionalStackTrace string

Additional information to append to the stack trace

TryResolveAvatar(out GameObject)

Attempts to find the original avatar that generated the report.

public bool TryResolveAvatar(out GameObject av)

Parameters

av GameObject

The avatar root

Returns

bool

true if the avatar was found, otherwise false

WithContextObject(Object)

Returns a disposable scope, within which all errors will reference a specific UnityObject.

public static IDisposable WithContextObject(UnityEngine.Object obj)

Parameters

obj Object

The object to reference (can be null)

Returns

IDisposable

A disposable that will remove the object from the current scope when disposed.

WithContextObject(Object, Action)

Executes a function, within which any errors will reference a specific UnityObject. Thrown exceptions will automatically be logged.

public static void WithContextObject(UnityEngine.Object obj, Action action)

Parameters

obj Object

The object to reference

action Action

WithContextObject<T>(Object, Func<T>)

Executes a function, within which any errors will reference a specific UnityObject. Thrown exceptions will automatically be logged.

public static T WithContextObject<T>(UnityEngine.Object obj, Func<T> func)

Parameters

obj Object

The object to reference

func Func<T>

The function to invoke

Returns

T

The return value of func()

Type Parameters

T