use thiserror::Error;
#[derive(Error, Debug)]
pub enum Error {
#[error("Channel {0} does not define a schema")]
NoSchema(String),
#[error("Invalid schema {schema}: {source:#}")]
InvalidSchema {
schema: String,
source: anyhow::Error,
},
#[error(
"MCAP summary is missing or corrupt; try reopening it with recovery enabled. Details: {details:#}"
)]
SummaryRequiresRecovery { details: anyhow::Error },
#[error("Not an MCAP file: missing start magic")]
MissingStartMagic,
#[error(transparent)]
Mcap(#[from] ::mcap::McapError),
#[error(transparent)]
Arrow(#[from] arrow::error::ArrowError),
#[error(transparent)]
Serialization(#[from] re_sdk_types::SerializationError),
#[error(transparent)]
Chunk(#[from] re_chunk::ChunkError),
#[error(transparent)]
Other(#[from] anyhow::Error),
}
impl Error {
#[inline]
pub fn other(err: impl Into<anyhow::Error>) -> Self {
Self::Other(err.into())
}
}