openssh_sftp_protocol_error/unix_timestamp_error.rs
1use std::{num::TryFromIntError, time::SystemTimeError};
2
3use thiserror::Error as ThisError;
4
5#[derive(Debug, ThisError)]
6#[non_exhaustive]
7pub enum UnixTimeStampError {
8 /// TimeStamp is earlier than 1970-01-01 00:00:00 UTC.
9 #[error("TimeStamp is earlier than 1970-01-01 00:00:00 UTC.")]
10 TooEarly(#[from] SystemTimeError),
11
12 /// TimeStamp is too large to be represented using u32 in seconds.
13 #[error("TimeStamp is too large to be represented using u32 in seconds.")]
14 TooLarge(#[from] TryFromIntError),
15}