Skip to main content

Error Handling

You can listen to an event OnException for whenever there is an unexpected error while doing relocalization.

// ARSharedAnchorManager.cs

// Attach a callback to this event to listen for whenever there is an error while doing relocalization
public delegate void SharedAnchorSubsystemException(Exception e);
public event SharedAnchorSubsystemException OnException;

Usage Example

[SerializeField]
private ARSharedAnchorManager _sharedAnchorManager;

private void OnEnable()
{
// Subscribe to event
_sharedAnchorManager.OnException += LogException;
}

private void OnDisable()
{
// Unsubscribe to event
_sharedAnchorManager.OnException -= LogException;
}

private void LogException(Exception e)
{
// Log the exception to console e.g.,
// Debug.LogException(e);
}