youtube_explode/lib/src/exceptions/video_unplayable_exception....

18 lines
628 B
Dart
Raw Normal View History

2020-02-23 21:00:35 +01:00
/// Thrown when a video is not playable and its streams cannot be resolved.
/// This can happen because the video requires purchase,
/// is blocked in your country, is controversial, or due to other reasons.
class VideoUnplayableException {
/// ID of the video.
final String videoId;
/// Reason why the video can't be played.
final String reason;
2020-02-23 21:00:35 +01:00
/// Initializes an instance of [VideoUnplayableException]
const VideoUnplayableException(this.videoId, [this.reason]);
2020-02-23 21:00:35 +01:00
String toString() =>
'VideoUnplayableException: Video $videoId couldn\'t be played.'
'${reason == null ? '' : 'Reason: $reason'}';
2020-02-23 21:00:35 +01:00
}