-
Notifications
You must be signed in to change notification settings - Fork 23
/
tmdb_exceptions.dart
46 lines (40 loc) · 1.34 KB
/
tmdb_exceptions.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
part of tmdb_api;
///Base exception
class TMDBException implements Exception {
final String message;
final String? source;
final String? help;
TMDBException(this.message, {this.source, this.help});
@override
String toString() {
return 'TMDBException() thrown message:$message | at source:$source | help:$help';
}
}
///Encountered a null value.
@Deprecated('Removed infavor of nullsafety. Will be removed in v2.1.0')
class NullValueException extends TMDBException {
@Deprecated('Removed infavor of nullsafety. Will be removed in v2.1.0')
NullValueException(
String message, {
String? source,
String help = 'try to pass a non null values',
}) : super(message, source: source, help: help);
@override
String toString() {
return 'NullValueException() thrown message:$message | at source:$source | help:$help';
}
}
///When constrains are not meet
@Deprecated('Infavor of ArgumentException. Will be removed in v2.1.0')
class InvalidDataException extends TMDBException {
@Deprecated('Infavor of ArgumentException. Will be removed in v2.1.0')
InvalidDataException(
String message, {
String? source,
String help = 'Data is invalid',
}) : super(message, source: source, help: help);
@override
String toString() {
return 'InvalidDataException() thrown message:$message | at source:$source | help:$help';
}
}