/// <summary> /// Send the specified exception as an event to the active state listener. </summary> /// <param name="exception"> Exception to send </param> public virtual void dispatchException(FriendlyException exception) { TrackStateListener currentListener = activeListener; ExceptionTools.log(log, exception, track.Identifier); if (currentListener != null) { trackException = exception; currentListener.onTrackException(track, exception); } }
public void execute(TrackStateListener listener) { try { hasStarted = true; activeListener = listener; remoteNodeManager.startPlaying(this); } catch (Exception throwable) { listener.onTrackException(track, ExceptionTools.wrapUnfriendlyExceptions("An error occurred when trying to start track remotely.", FriendlyException.Severity.FAULT, throwable)); ExceptionTools.rethrowErrors(throwable); } }
/// <summary> /// Detach the currently active listener, so no useless reference would be kept and no events would be sent there. /// </summary> public virtual void detach() { activeListener = null; markerTracker.trigger(MarkerState.ENDED); }