Skip to content

Commit

Permalink
chore: enrich error logs (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewjl-mux authored Jul 22, 2024
1 parent 83bf223 commit 0aa3009
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
28 changes: 27 additions & 1 deletion Sources/MuxPlayerSwift/FairPlay/ContentKeySessionDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,34 @@ class ContentKeySessionDelegate<SessionManager: FairPlayStreamingSessionCredenti
err: any Error
) {
logger.debug(
"CK Request Failed Error: \(err.localizedDescription)"
"CK Request Failed Error Localized Description: \(err.localizedDescription)"
)

if let error = err as? NSError {

Check warning on line 61 in Sources/MuxPlayerSwift/FairPlay/ContentKeySessionDelegate.swift

View workflow job for this annotation

GitHub Actions / Run Unit Tests

conditional cast from 'any Error' to 'NSError' always succeeds

Check warning on line 61 in Sources/MuxPlayerSwift/FairPlay/ContentKeySessionDelegate.swift

View workflow job for this annotation

GitHub Actions / Run Unit Tests

conditional cast from 'any Error' to 'NSError' always succeeds
if let localizedFailureReason = error.localizedFailureReason {
logger.debug(
"CK Request Failed Error Localized Failure Reason: \(localizedFailureReason))"
)
}

logger.debug(
"CK Request Failed Error Code: \(error.code)"
)

logger.debug(
"CK Request Failed Error User Info: \(error.userInfo)"
)

if let underlyingError = error.userInfo[NSUnderlyingErrorKey] as? NSError {
logger.debug(
"CK Request Failed Underlying Error Localized Description: \(underlyingError.localizedDescription)"
)

logger.debug(
"CK Request Failed Underlying Error Code: \(underlyingError.code)"
)
}
}
}

func contentKeySession(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public struct SemanticVersion {
public static let minor = 1

/// Patch version component.
public static let patch = 0
public static let patch = 1

/// String form of the version number in the format X.Y.Z
/// where X, Y, and Z are the major, minor, and patch
Expand Down

0 comments on commit 0aa3009

Please sign in to comment.