#[derive(Debug, Clone, PartialEq, Eq, thiserror::Error)]
pub enum PathError {
#[error("path {path:?} contains a \"..\" segment; paths cannot leave their base")]
ParentSegment { path: String },
#[error("path {path:?} is empty, which would point at the whole {store}")]
Empty { path: String, store: &'static str },
#[error("path {path:?} contains a control character")]
ControlCharacter { path: String },
#[error("template {template:?} uses {{{placeholder}}}, which is not one of: {known}")]
UnknownPlaceholder {
template: String,
placeholder: String,
known: String,
},
#[error("template {template:?} has an unclosed '{{'")]
UnclosedPlaceholder { template: String },
#[error("value {value:?} for {{{placeholder}}} contains '/', which would add folders")]
SlashInValue { placeholder: String, value: String },
#[error(
"{url:?} is not a location SQLLoad understands; use s3://bucket/path, file:///abs/path or an absolute path"
)]
UnknownScheme { url: String },
#[error(
"{url:?} points at {found}, but connection {connection:?} is {expected}; give a path relative to the connection"
)]
ConnectionMismatch {
url: String,
connection: String,
found: String,
expected: String,
},
}