Class ErrorReport
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
AvatarRootPath
The path (from the scene root) of the avatar being processed
public string AvatarRootPath { get; }
Property Value
Errors
A list of reported errors.
public ImmutableList<ErrorContext> Errors { get; }
Property Value
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
actionAction
Returns
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
errorIError
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
localizerLocalizerThe Localizer used to look up translations
errorSeverityErrorSeverityThe severity of the error
keystringThe prefix used to find localization keys
argsobject[]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
eExceptionException to report
additionalStackTracestringAdditional 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
avGameObjectThe 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
objObjectThe 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
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
Returns
- T
The return value of func()
Type Parameters
T