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
action
Action
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
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
LocalizerThe Localizer used to look up translations
errorSeverity
ErrorSeverityThe severity of the error
key
stringThe 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
ExceptionException to report
additionalStackTrace
stringAdditional 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
GameObjectThe 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
ObjectThe 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