BlockReasonException
An exception thrown when a Chapter is blocked for a specific reason. The specific reason is indicated by the type of BlockReasonException thrown.
Each subclass of BlockReasonException corresponds to a specific BlockReason and provides a messageResId containing a user-friendly localized message describing the block reason.
Checking the blocking reason
val exception: BlockReasonException
when (exception) {
is BlockReasonException.GeoBlock -> Log.d("Pillarbox", "This chapter is geo-blocked")
is BlockReasonException.StartDate -> Log.d("Pillarbox", "This chapter will be available on ${exception.instant}.")
is BlockReasonException.EndDate -> Log.d("Pillarbox", "This chapter is no longer available since ${exception.instant}.")
// Handle other types...
}
Parameters
The exception message.
Inheritors
Types
Represents an exception thrown when a Chapter is blocked due to an age rating of 12. This corresponds to BlockReason.AGERATING12.
Represents an exception thrown when a Chapter is blocked due to an age rating of 18. This corresponds to BlockReason.AGERATING18.
Represents an exception thrown when a Chapter is blocked for commercial reason. This corresponds to BlockReason.COMMERCIAL.
Represents an exception thrown when a Chapter is blocked due to reaching its end date. This corresponds to BlockReason.ENDDATE.
Represents an exception thrown when a Chapter is blocked due to geographical restrictions. This corresponds to BlockReason.GEOBLOCK.
Represents an exception thrown when a Chapter is blocked for journalistic reason. This corresponds to BlockReason.JOURNALISTIC.
Represents an exception thrown when a Chapter is blocked due to legal reasons. This corresponds to BlockReason.LEGAL.
Represents an exception thrown when a Chapter is blocked due to its start date being in the future. This corresponds to BlockReason.STARTDATE.
Represents an exception thrown when a Chapter is blocked for an unknown reason. This corresponds to BlockReason.UNKNOWN.