xref: /xiu/protocol/rtmp/src/netstream/errors.rs (revision e1aaa799)
1 
2 
3 use failure::{Backtrace, Fail};
4 use std::fmt;
5 use std::io;
6 use crate::amf0::errors::{Amf0WriteError, Amf0WriteErrorValue};
7 
8 
9 pub struct NetStreamError {
10     pub value: NetStreamErrorValue,
11 }
12 
13 
14 pub enum NetStreamErrorValue {
15 
16 
17     Amf0WriteError(Amf0WriteError),
18 
19     InvalidMaxChunkSize { chunk_size: usize },
20 
21 
22 }
23 
24 
25 
26 
27 impl From<Amf0WriteError> for NetStreamError {
28     fn from(error: Amf0WriteError) -> Self {
29         NetStreamError {
30             value: NetStreamErrorValue::Amf0WriteError(error),
31         }
32     }
33 }
34