youtube_explode/lib/src/exceptions/video_unavailable_exception...

20 lines
1.1 KiB
Dart
Raw Normal View History

2020-06-03 23:02:21 +02:00
import '../videos/video_id.dart';
2020-05-31 23:36:23 +02:00
import 'exceptions.dart';
2020-02-23 21:00:35 +01:00
/// Thrown when a video is not available and cannot be processed.
/// This can happen because the video does not exist, is deleted,
/// is private, or due to other reasons.
2021-07-15 23:43:47 +02:00
class VideoUnavailableException extends VideoUnplayableException {
2020-02-23 21:00:35 +01:00
/// Initializes an instance of [VideoUnavailableException]
2021-07-15 23:43:47 +02:00
VideoUnavailableException(String message) : super(message);
2020-02-23 21:00:35 +01:00
2020-05-31 23:36:23 +02:00
/// Initializes an instance of [VideoUnplayableException] with a [VideoId]
VideoUnavailableException.unavailable(VideoId videoId)
2021-07-15 23:43:47 +02:00
: super('Video \'$videoId\' is unavailable\n'
2020-05-31 23:36:23 +02:00
'In most cases, this error indicates that the video doesn\'t exist, ' // ignore: lines_longer_than_80_chars
'is private, or has been taken down.\n'
'If you can however open this video in your browser in incognito mode, ' // ignore: lines_longer_than_80_chars
'it most likely means that YouTube changed something, which broke this library.\n' // ignore: lines_longer_than_80_chars
2021-07-15 23:43:47 +02:00
'Please report this issue on GitHub in that case.');
2020-02-23 21:00:35 +01:00
}