Skip to content

Commit 46f4c63

Browse files
authored
Update usage for the HttpClient (#108)
1 parent dd5c1f6 commit 46f4c63

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

readium/lcp/r2-lcp/src/main/java/org/readium/r2/lcp/LcpContentProtection.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ internal class LcpContentProtection(
3030
sender: Any?
3131
): Try<ContentProtection.ProtectedAsset, Publication.OpeningException>? {
3232
if (asset !is FileAsset) {
33-
Timber.e("Only `FileAsset` is supported with the `LcpContentProtection`. Make sure you are trying to open a package from the file system.")
34-
return Try.failure(Publication.OpeningException.UnsupportedFormat)
33+
return Try.failure(Publication.OpeningException.UnsupportedFormat(Exception("Only `FileAsset` is supported with the `LcpContentProtection`, make sure you are trying to open a package from the file system")))
3534
}
3635

3736
if (!lcpService.isLcpProtected(asset.file)) {

readium/lcp/r2-lcp/src/main/java/org/readium/r2/lcp/LcpDecryptor.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ internal class LcpDecryptor(val license: LcpLicense?) {
3939
return@LazyResource resource
4040

4141
when {
42-
license == null -> FailureResource(link, Resource.Exception.Forbidden)
42+
license == null -> FailureResource(link, Resource.Exception.Forbidden())
4343
link.isDeflated || !link.isCbcEncrypted -> FullLcpResource(resource, license)
4444
else -> CbcLcpResource(resource, license)
4545
}

0 commit comments

Comments
 (0)