use thiserror::Error;
use crate::ChunkPos;
#[derive(Debug, Clone, PartialEq, Eq, Error)]
pub enum WorldError {
#[error("chunk {pos:?}: data too short ({len} bytes, need {need})")]
Truncated {
pos: ChunkPos,
len: usize,
need: usize,
},
#[error("map_chunk_bulk: data too short ({len} bytes, need {need})")]
BulkTruncated {
len: usize,
need: usize,
},
#[error("chunk {pos:?} section {section}: {reason}")]
Section {
pos: ChunkPos,
section: u8,
reason: &'static str,
},
}