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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
use SubtitleFormat;
pub use formats::idx::errors as idx_errors;
pub use formats::microdvd::errors as mdvd_errors;
pub use formats::srt::errors as srt_errors;
pub use formats::ssa::errors as ssa_errors;
pub use formats::vobsub::errors as vob_errors;
#[cfg_attr(rustfmt, rustfmt_skip)]
error_chain! {
foreign_links {
FromUtf8Error(::std::string::FromUtf8Error)
;
}
links {
SsaError(ssa_errors::Error, ssa_errors::ErrorKind)
;
IdxError(idx_errors::Error, idx_errors::ErrorKind)
;
SrtError(srt_errors::Error, srt_errors::ErrorKind)
;
VobError(vob_errors::Error, vob_errors::ErrorKind)
;
MdvdError(mdvd_errors::Error, mdvd_errors::ErrorKind)
;
}
errors {
UnknownFileFormat {
description("unknown file format, only SubRip (.srt), SubStationAlpha (.ssa/.ass) and VobSub (.idx and .sub) are supported at the moment")
}
DecodingError {
description("error while decoding subtitle from bytes to string (wrong charset encoding?)")
}
TextFormatOnly {
description("operation does not work on binary subtitle formats (only text formats)")
}
UpdatingEntriesNotSupported(format: SubtitleFormat) {
description("updating subtitles is not implemented or supported by the `subparse` library for this format")
display("updating subtitles is not implemented or supported by the `subparse` library for this format: {}", format.get_name())
}
}
}