mirror of
https://github.com/samsonjs/media.git
synced 2026-04-02 10:45:51 +00:00
Add errorCode to the EventLogger
PiperOrigin-RevId: 376126959
This commit is contained in:
parent
0fb5fa75cf
commit
c353151288
2 changed files with 12 additions and 0 deletions
|
|
@ -243,6 +243,14 @@ public class PlaybackException extends Exception implements Bundleable {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Equivalent to {@link PlaybackException#getErrorCodeName(int)
|
||||
* PlaybackException.getErrorCodeName(this.errorCode)}.
|
||||
*/
|
||||
public final String getErrorCodeName() {
|
||||
return getErrorCodeName(errorCode);
|
||||
}
|
||||
|
||||
/** An error code which identifies the cause of the playback failure. */
|
||||
@ErrorCode public final int errorCode;
|
||||
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ import com.google.android.exoplayer2.C;
|
|||
import com.google.android.exoplayer2.ExoPlaybackException;
|
||||
import com.google.android.exoplayer2.Format;
|
||||
import com.google.android.exoplayer2.MediaItem;
|
||||
import com.google.android.exoplayer2.PlaybackException;
|
||||
import com.google.android.exoplayer2.PlaybackParameters;
|
||||
import com.google.android.exoplayer2.Player;
|
||||
import com.google.android.exoplayer2.Player.PlaybackSuppressionReason;
|
||||
|
|
@ -598,6 +599,9 @@ public class EventLogger implements AnalyticsListener {
|
|||
@Nullable String eventDescription,
|
||||
@Nullable Throwable throwable) {
|
||||
String eventString = eventName + " [" + getEventTimeString(eventTime);
|
||||
if (throwable instanceof PlaybackException) {
|
||||
eventString += ", errorCode=" + ((PlaybackException) throwable).getErrorCodeName();
|
||||
}
|
||||
if (eventDescription != null) {
|
||||
eventString += ", " + eventDescription;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue